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_macros.h" | 8 #include "base/metrics/histogram_macros.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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
104 | 104 |
105 void WebViewPlugin::RestoreTitleText() { | 105 void WebViewPlugin::RestoreTitleText() { |
106 if (container_) | 106 if (container_) |
107 container_->element().setAttribute("title", old_title_); | 107 container_->element().setAttribute("title", old_title_); |
108 } | 108 } |
109 | 109 |
110 WebPluginContainer* WebViewPlugin::container() const { return container_; } | 110 WebPluginContainer* WebViewPlugin::container() const { return container_; } |
111 | 111 |
112 bool WebViewPlugin::initialize(WebPluginContainer* container) { | 112 bool WebViewPlugin::initialize(WebPluginContainer* container) { |
113 container_ = container; | 113 container_ = container; |
114 if (container_) { | 114 if (container_) { |
chrishtr
2015/07/21 20:43:58
Please add a comment summarizing why setNeedsLayou
Stephen Chennney
2015/07/21 21:03:11
Done.
| |
115 container_->setNeedsLayout(); | |
chrishtr
2015/07/21 20:43:58
This call is definitely needed. Here is what can h
Stephen Chennney
2015/07/21 21:03:11
Acknowledged.
| |
115 old_title_ = container_->element().getAttribute("title"); | 116 old_title_ = container_->element().getAttribute("title"); |
116 | 117 |
117 // Propagate device scale to inner webview to load the correct resource | 118 // Propagate device scale to inner webview to load the correct resource |
118 // when images have a "srcset" attribute. | 119 // when images have a "srcset" attribute. |
119 web_view_->setDeviceScaleFactor(container_->deviceScaleFactor()); | 120 web_view_->setDeviceScaleFactor(container_->deviceScaleFactor()); |
120 } | 121 } |
121 return true; | 122 return true; |
122 } | 123 } |
123 | 124 |
124 void WebViewPlugin::destroy() { | 125 void WebViewPlugin::destroy() { |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
279 | 280 |
280 global->Set(gin::StringToV8(isolate, "plugin"), | 281 global->Set(gin::StringToV8(isolate, "plugin"), |
281 delegate_->GetV8Handle(isolate)); | 282 delegate_->GetV8Handle(isolate)); |
282 } | 283 } |
283 | 284 |
284 void WebViewPlugin::didReceiveResponse(WebLocalFrame* frame, | 285 void WebViewPlugin::didReceiveResponse(WebLocalFrame* frame, |
285 unsigned identifier, | 286 unsigned identifier, |
286 const WebURLResponse& response) { | 287 const WebURLResponse& response) { |
287 WebFrameClient::didReceiveResponse(frame, identifier, response); | 288 WebFrameClient::didReceiveResponse(frame, identifier, response); |
288 } | 289 } |
OLD | NEW |