This source file includes following definitions.
- color_
- paintPageOverlay
#include "chrome/renderer/webview_color_overlay.h"
#include "base/logging.h"
#include "content/public/renderer/render_view.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkPaint.h"
#include "third_party/skia/include/core/SkRect.h"
#include "third_party/WebKit/public/web/WebView.h"
#include "ui/gfx/size.h"
#include "ui/gfx/skia_util.h"
WebViewColorOverlay::WebViewColorOverlay(content::RenderView* render_view,
SkColor color)
: render_view_(render_view),
color_(color) {
render_view_->GetWebView()->addPageOverlay(this, 0);
}
WebViewColorOverlay::~WebViewColorOverlay() {
if (render_view_->GetWebView())
render_view_->GetWebView()->removePageOverlay(this);
}
void WebViewColorOverlay::paintPageOverlay(blink::WebCanvas* canvas) {
SkRect rect = gfx::RectToSkRect(gfx::Rect(render_view_->GetSize()));
SkPaint paint;
paint.setColor(color_);
paint.setStyle(SkPaint::kFill_Style);
canvas->drawRect(rect, paint);
}