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

Unified Diff: components/plugins/renderer/webview_plugin.cc

Issue 296983017: WebViewPlugin: Apply Prefs to WebSettings before creating a WebLocalFrame (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/plugins/renderer/webview_plugin.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/plugins/renderer/webview_plugin.cc
diff --git a/components/plugins/renderer/webview_plugin.cc b/components/plugins/renderer/webview_plugin.cc
index b69a8c031cfa88a73523ce55df03b271696b82d7..1e8399560f09b767cfc76cfb3f69ac336a70d1ae 100644
--- a/components/plugins/renderer/webview_plugin.cc
+++ b/components/plugins/renderer/webview_plugin.cc
@@ -41,13 +41,17 @@ using blink::WebURLResponse;
using blink::WebVector;
using blink::WebView;
-WebViewPlugin::WebViewPlugin(WebViewPlugin::Delegate* delegate)
+WebViewPlugin::WebViewPlugin(WebViewPlugin::Delegate* delegate,
+ const WebPreferences& preferences)
: delegate_(delegate),
container_(NULL),
web_view_(WebView::create(this)),
- web_frame_(WebLocalFrame::create(this)),
finished_loading_(false),
focused_(false) {
+ // ApplyWebPreferences before making a WebLocalFrame so that the frame sees a
+ // consistent view of our preferences.
+ content::ApplyWebPreferences(preferences, web_view_);
+ web_frame_ = WebLocalFrame::create(this);
web_view_->setMainFrame(web_frame_);
}
@@ -56,10 +60,8 @@ WebViewPlugin* WebViewPlugin::Create(WebViewPlugin::Delegate* delegate,
const WebPreferences& preferences,
const std::string& html_data,
const GURL& url) {
- WebViewPlugin* plugin = new WebViewPlugin(delegate);
- WebView* web_view = plugin->web_view();
- content::ApplyWebPreferences(preferences, web_view);
- web_view->mainFrame()->loadHTMLString(html_data, url);
+ WebViewPlugin* plugin = new WebViewPlugin(delegate, preferences);
+ plugin->web_view()->mainFrame()->loadHTMLString(html_data, url);
return plugin;
}
« no previous file with comments | « components/plugins/renderer/webview_plugin.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698