Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: chrome/renderer/webview_color_overlay.cc

Issue 832953002: Cleanup: Update the path to gfx size headers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: REBASE Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/renderer/web_apps.cc ('k') | chrome/utility/chrome_content_utility_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/webview_color_overlay.h" 5 #include "chrome/renderer/webview_color_overlay.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/public/renderer/render_view.h" 8 #include "content/public/renderer/render_view.h"
9 #include "third_party/WebKit/public/web/WebView.h"
9 #include "third_party/skia/include/core/SkCanvas.h" 10 #include "third_party/skia/include/core/SkCanvas.h"
10 #include "third_party/skia/include/core/SkPaint.h" 11 #include "third_party/skia/include/core/SkPaint.h"
11 #include "third_party/skia/include/core/SkRect.h" 12 #include "third_party/skia/include/core/SkRect.h"
12 #include "third_party/WebKit/public/web/WebView.h" 13 #include "ui/gfx/geometry/size.h"
13 #include "ui/gfx/size.h"
14 #include "ui/gfx/skia_util.h" 14 #include "ui/gfx/skia_util.h"
15 15
16 WebViewColorOverlay::WebViewColorOverlay(content::RenderView* render_view, 16 WebViewColorOverlay::WebViewColorOverlay(content::RenderView* render_view,
17 SkColor color) 17 SkColor color)
18 : render_view_(render_view), 18 : render_view_(render_view),
19 color_(color) { 19 color_(color) {
20 render_view_->GetWebView()->addPageOverlay(this, 0); 20 render_view_->GetWebView()->addPageOverlay(this, 0);
21 } 21 }
22 22
23 WebViewColorOverlay::~WebViewColorOverlay() { 23 WebViewColorOverlay::~WebViewColorOverlay() {
24 if (render_view_->GetWebView()) 24 if (render_view_->GetWebView())
25 render_view_->GetWebView()->removePageOverlay(this); 25 render_view_->GetWebView()->removePageOverlay(this);
26 } 26 }
27 27
28 void WebViewColorOverlay::paintPageOverlay(blink::WebCanvas* canvas) { 28 void WebViewColorOverlay::paintPageOverlay(blink::WebCanvas* canvas) {
29 SkRect rect = gfx::RectToSkRect(gfx::Rect(render_view_->GetSize())); 29 SkRect rect = gfx::RectToSkRect(gfx::Rect(render_view_->GetSize()));
30 SkPaint paint; 30 SkPaint paint;
31 paint.setColor(color_); 31 paint.setColor(color_);
32 paint.setStyle(SkPaint::kFill_Style); 32 paint.setStyle(SkPaint::kFill_Style);
33 canvas->drawRect(rect, paint); 33 canvas->drawRect(rect, paint);
34 } 34 }
OLDNEW
« no previous file with comments | « chrome/renderer/web_apps.cc ('k') | chrome/utility/chrome_content_utility_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698