| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 } | 146 } |
| 147 | 147 |
| 148 // Coordinates are relative to the containing window. | 148 // Coordinates are relative to the containing window. |
| 149 void WebViewPlugin::updateGeometry(const WebRect& frame_rect, | 149 void WebViewPlugin::updateGeometry(const WebRect& frame_rect, |
| 150 const WebRect& clip_rect, | 150 const WebRect& clip_rect, |
| 151 const WebVector<WebRect>& cut_out_rects, | 151 const WebVector<WebRect>& cut_out_rects, |
| 152 bool is_visible) { | 152 bool is_visible) { |
| 153 if (static_cast<gfx::Rect>(frame_rect) != rect_) { | 153 if (static_cast<gfx::Rect>(frame_rect) != rect_) { |
| 154 rect_ = frame_rect; | 154 rect_ = frame_rect; |
| 155 WebSize newSize(frame_rect.width, frame_rect.height); | 155 WebSize newSize(frame_rect.width, frame_rect.height); |
| 156 web_view_->setFixedLayoutSize(newSize); | |
| 157 web_view_->resize(newSize); | 156 web_view_->resize(newSize); |
| 158 } | 157 } |
| 159 } | 158 } |
| 160 | 159 |
| 161 void WebViewPlugin::updateFocus(bool focused) { | 160 void WebViewPlugin::updateFocus(bool focused) { |
| 162 focused_ = focused; | 161 focused_ = focused; |
| 163 } | 162 } |
| 164 | 163 |
| 165 bool WebViewPlugin::acceptsInputEvents() { return true; } | 164 bool WebViewPlugin::acceptsInputEvents() { return true; } |
| 166 | 165 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 void WebViewPlugin::didClearWindowObject(WebLocalFrame* frame) { | 242 void WebViewPlugin::didClearWindowObject(WebLocalFrame* frame) { |
| 244 if (delegate_) | 243 if (delegate_) |
| 245 delegate_->BindWebFrame(frame); | 244 delegate_->BindWebFrame(frame); |
| 246 } | 245 } |
| 247 | 246 |
| 248 void WebViewPlugin::didReceiveResponse(WebLocalFrame* frame, | 247 void WebViewPlugin::didReceiveResponse(WebLocalFrame* frame, |
| 249 unsigned identifier, | 248 unsigned identifier, |
| 250 const WebURLResponse& response) { | 249 const WebURLResponse& response) { |
| 251 WebFrameClient::didReceiveResponse(frame, identifier, response); | 250 WebFrameClient::didReceiveResponse(frame, identifier, response); |
| 252 } | 251 } |
| OLD | NEW |