diff options
author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-30 11:24:51 +0000 |
---|---|---|
committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-30 11:24:51 +0000 |
commit | 57b66d09c510ff03605c9dddc289a17dc79f17e7 (patch) | |
tree | c8dd27f47eb1ea5f00ead6cc1898ec997597228f /webkit | |
parent | e6437b5b5aef788023788991840e2de227480da1 (diff) | |
download | chromium_src-57b66d09c510ff03605c9dddc289a17dc79f17e7.zip chromium_src-57b66d09c510ff03605c9dddc289a17dc79f17e7.tar.gz chromium_src-57b66d09c510ff03605c9dddc289a17dc79f17e7.tar.bz2 |
Move disabling outdated plugins to labs and update UI to Glen's mocks.
BUG=47731
TEST=Disabling outdated plugins should show up in about:labs
Review URL: http://codereview.chromium.org/3386033
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61055 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/plugins/webview_plugin.cc | 20 | ||||
-rw-r--r-- | webkit/glue/plugins/webview_plugin.h | 10 |
2 files changed, 27 insertions, 3 deletions
diff --git a/webkit/glue/plugins/webview_plugin.cc b/webkit/glue/plugins/webview_plugin.cc index 231bd37..9287028 100644 --- a/webkit/glue/plugins/webview_plugin.cc +++ b/webkit/glue/plugins/webview_plugin.cc @@ -9,12 +9,12 @@ #include "third_party/WebKit/WebKit/chromium/public/WebCursorInfo.h" #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/WebKit/chromium/public/WebPluginContainer.h" -#include "third_party/WebKit/WebKit/chromium/public/WebSettings.h" #include "third_party/WebKit/WebKit/chromium/public/WebSize.h" #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" #include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h" #include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h" #include "third_party/WebKit/WebKit/chromium/public/WebView.h" +#include "webkit/glue/webpreferences.h" #if WEBKIT_USING_CG #include <CoreGraphics/CGContext.h> @@ -48,6 +48,18 @@ WebViewPlugin::WebViewPlugin(WebViewPlugin::Delegate* delegate) web_view_->initializeMainFrame(this); } +// static +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(); + preferences.Apply(web_view); + web_view->mainFrame()->loadHTMLString(html_data, url); + return plugin; +} + WebViewPlugin::~WebViewPlugin() { web_view_->close(); } @@ -78,8 +90,10 @@ bool WebViewPlugin::initialize(WebPluginContainer* container) { } void WebViewPlugin::destroy() { - delegate_->WillDestroyPlugin(); - delegate_ = NULL; + if (delegate_) { + delegate_->WillDestroyPlugin(); + delegate_ = NULL; + } container_ = NULL; MessageLoop::current()->DeleteSoon(FROM_HERE, this); } diff --git a/webkit/glue/plugins/webview_plugin.h b/webkit/glue/plugins/webview_plugin.h index 757a012..9695aa2 100644 --- a/webkit/glue/plugins/webview_plugin.h +++ b/webkit/glue/plugins/webview_plugin.h @@ -15,6 +15,8 @@ #include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h" #include "third_party/WebKit/WebKit/chromium/public/WebViewClient.h" +struct WebPreferences; + // This class implements the WebPlugin interface by forwarding drawing and // handling input events to a WebView. // It can be used as a placeholder for an actual plugin, using HTML for the UI. @@ -39,6 +41,14 @@ class WebViewPlugin: public WebKit::WebPlugin, public WebKit::WebViewClient, explicit WebViewPlugin(Delegate* delegate); + // Convenience method to set up a new WebViewPlugin using |preferences| + // and displaying |html_data|. |url| should be a (fake) chrome:// URL; it is + // only used for navigation and never actually resolved. + static WebViewPlugin* Create(Delegate* delegate, + const WebPreferences& preferences, + const std::string& html_data, + const GURL& url); + WebKit::WebView* web_view() { return web_view_; } WebKit::WebPluginContainer* container() { return container_; } |