| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/plugins/renderer/webview_plugin.h" | 5 #include "components/plugins/renderer/webview_plugin.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/numerics/safe_conversions.h" | 9 #include "base/numerics/safe_conversions.h" |
| 10 #include "content/public/common/web_preferences.h" | 10 #include "content/public/common/web_preferences.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 SkFloatToScalar(1.0 / container_->deviceScaleFactor()); | 150 SkFloatToScalar(1.0 / container_->deviceScaleFactor()); |
| 151 canvas->scale(inverse_scale, inverse_scale); | 151 canvas->scale(inverse_scale, inverse_scale); |
| 152 | 152 |
| 153 web_view_->layout(); | 153 web_view_->layout(); |
| 154 web_view_->paint(canvas, paint_rect); | 154 web_view_->paint(canvas, paint_rect); |
| 155 | 155 |
| 156 canvas->restore(); | 156 canvas->restore(); |
| 157 } | 157 } |
| 158 | 158 |
| 159 // Coordinates are relative to the containing window. | 159 // Coordinates are relative to the containing window. |
| 160 void WebViewPlugin::updateGeometry(const WebRect& frame_rect, | 160 void WebViewPlugin::updateGeometry(const WebRect& window_rect, |
| 161 const WebRect& clip_rect, | 161 const WebRect& clip_rect, |
| 162 const WebVector<WebRect>& cut_out_rects, | 162 const WebRect& unobscured_rect, |
| 163 const WebVector<WebRect>& cut_outs_rects, |
| 163 bool is_visible) { | 164 bool is_visible) { |
| 164 if (static_cast<gfx::Rect>(frame_rect) != rect_) { | 165 if (static_cast<gfx::Rect>(window_rect) != rect_) { |
| 165 rect_ = frame_rect; | 166 rect_ = window_rect; |
| 166 WebSize newSize(frame_rect.width, frame_rect.height); | 167 WebSize newSize(window_rect.width, window_rect.height); |
| 167 web_view_->resize(newSize); | 168 web_view_->resize(newSize); |
| 168 } | 169 } |
| 169 } | 170 } |
| 170 | 171 |
| 171 void WebViewPlugin::updateFocus(bool focused, blink::WebFocusType focus_type) { | 172 void WebViewPlugin::updateFocus(bool focused, blink::WebFocusType focus_type) { |
| 172 focused_ = focused; | 173 focused_ = focused; |
| 173 } | 174 } |
| 174 | 175 |
| 175 bool WebViewPlugin::acceptsInputEvents() { return true; } | 176 bool WebViewPlugin::acceptsInputEvents() { return true; } |
| 176 | 177 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 void WebViewPlugin::didClearWindowObject(WebLocalFrame* frame) { | 254 void WebViewPlugin::didClearWindowObject(WebLocalFrame* frame) { |
| 254 if (delegate_) | 255 if (delegate_) |
| 255 delegate_->BindWebFrame(frame); | 256 delegate_->BindWebFrame(frame); |
| 256 } | 257 } |
| 257 | 258 |
| 258 void WebViewPlugin::didReceiveResponse(WebLocalFrame* frame, | 259 void WebViewPlugin::didReceiveResponse(WebLocalFrame* frame, |
| 259 unsigned identifier, | 260 unsigned identifier, |
| 260 const WebURLResponse& response) { | 261 const WebURLResponse& response) { |
| 261 WebFrameClient::didReceiveResponse(frame, identifier, response); | 262 WebFrameClient::didReceiveResponse(frame, identifier, response); |
| 262 } | 263 } |
| OLD | NEW |