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

Side by Side Diff: webkit/plugins/webview_plugin.cc

Issue 11270042: Add non-member non-mutating methods for common gfx::Rect operations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « webkit/plugins/ppapi/ppb_graphics_2d_impl.cc ('k') | no next file » | 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 "webkit/plugins/webview_plugin.h" 5 #include "webkit/plugins/webview_plugin.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "skia/ext/platform_canvas.h" 9 #include "skia/ext/platform_canvas.h"
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 113
114 NPObject* WebViewPlugin::scriptableObject() { 114 NPObject* WebViewPlugin::scriptableObject() {
115 return NULL; 115 return NULL;
116 } 116 }
117 117
118 bool WebViewPlugin::getFormValue(WebString& value) { 118 bool WebViewPlugin::getFormValue(WebString& value) {
119 return false; 119 return false;
120 } 120 }
121 121
122 void WebViewPlugin::paint(WebCanvas* canvas, const WebRect& rect) { 122 void WebViewPlugin::paint(WebCanvas* canvas, const WebRect& rect) {
123 gfx::Rect paintRect = rect_; 123 gfx::Rect paintRect = gfx::IntersectRects(rect_, rect);
124 paintRect.Intersect(rect);
125 if (paintRect.IsEmpty()) 124 if (paintRect.IsEmpty())
126 return; 125 return;
127 126
128 paintRect.Offset(-rect_.x(), -rect_.y()); 127 paintRect.Offset(-rect_.x(), -rect_.y());
129 128
130 canvas->translate(SkIntToScalar(rect_.x()), SkIntToScalar(rect_.y())); 129 canvas->translate(SkIntToScalar(rect_.x()), SkIntToScalar(rect_.y()));
131 canvas->save(); 130 canvas->save();
132 131
133 web_view_->layout(); 132 web_view_->layout();
134 web_view_->paint(canvas, paintRect); 133 web_view_->paint(canvas, paintRect);
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 return error; 233 return error;
235 } 234 }
236 235
237 void WebViewPlugin::didReceiveResponse(WebFrame* frame, 236 void WebViewPlugin::didReceiveResponse(WebFrame* frame,
238 unsigned identifier, 237 unsigned identifier,
239 const WebURLResponse& response) { 238 const WebURLResponse& response) {
240 WebFrameClient::didReceiveResponse(frame, identifier, response); 239 WebFrameClient::didReceiveResponse(frame, identifier, response);
241 } 240 }
242 241
243 } // namespace webkit 242 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/ppb_graphics_2d_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698