| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |