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

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

Issue 12230018: Fix the size of webview in WebViewPlugin (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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/Platform/chromium/public/WebSize.h" 10 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 web_view_->layout(); 133 web_view_->layout();
134 web_view_->paint(canvas, paint_rect); 134 web_view_->paint(canvas, paint_rect);
135 135
136 canvas->restore(); 136 canvas->restore();
137 } 137 }
138 138
139 // Coordinates are relative to the containing window. 139 // Coordinates are relative to the containing window.
140 void WebViewPlugin::updateGeometry( 140 void WebViewPlugin::updateGeometry(
141 const WebRect& frame_rect, const WebRect& clip_rect, 141 const WebRect& frame_rect, const WebRect& clip_rect,
142 const WebVector<WebRect>& cut_out_rects, bool is_visible) { 142 const WebVector<WebRect>& cut_out_rects, bool is_visible) {
143 if (static_cast<gfx::Rect>(frame_rect) != rect_) 143 if (static_cast<gfx::Rect>(frame_rect) != rect_) {
144 rect_ = frame_rect; 144 rect_ = frame_rect;
145 web_view_->resize(WebSize(frame_rect.width, frame_rect.height));
146 }
145 } 147 }
146 148
147 bool WebViewPlugin::acceptsInputEvents() { 149 bool WebViewPlugin::acceptsInputEvents() {
148 return true; 150 return true;
149 } 151 }
150 152
151 bool WebViewPlugin::handleInputEvent(const WebInputEvent& event, 153 bool WebViewPlugin::handleInputEvent(const WebInputEvent& event,
152 WebCursorInfo& cursor) { 154 WebCursorInfo& cursor) {
153 // For tap events, don't handle them. They will be converted to 155 // For tap events, don't handle them. They will be converted to
154 // mouse events later and passed to here. 156 // mouse events later and passed to here.
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 return error; 240 return error;
239 } 241 }
240 242
241 void WebViewPlugin::didReceiveResponse(WebFrame* frame, 243 void WebViewPlugin::didReceiveResponse(WebFrame* frame,
242 unsigned identifier, 244 unsigned identifier,
243 const WebURLResponse& response) { 245 const WebURLResponse& response) {
244 WebFrameClient::didReceiveResponse(frame, identifier, response); 246 WebFrameClient::didReceiveResponse(frame, identifier, response);
245 } 247 }
246 248
247 } // namespace webkit 249 } // namespace webkit
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698