diff options
author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-06 15:50:57 +0000 |
---|---|---|
committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-06 15:50:57 +0000 |
commit | 250afb0e2366b9cffd7831f085be4701e81eb636 (patch) | |
tree | c66897fd54bc3031c05a39f93d5e4d9486ace92d /chrome | |
parent | 8b86363bc6c71aed7d10bef1c496b558faac5628 (diff) | |
download | chromium_src-250afb0e2366b9cffd7831f085be4701e81eb636.zip chromium_src-250afb0e2366b9cffd7831f085be4701e81eb636.tar.gz chromium_src-250afb0e2366b9cffd7831f085be4701e81eb636.tar.bz2 |
Revert 55227 - Disable outdated non-sandboxed plugins.
BUG=47731
TEST=Run with --disable-outdated-plugins
Review URL: http://codereview.chromium.org/3038051
TBR=bauerb@chromium.org
Review URL: http://codereview.chromium.org/3083021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55229 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
20 files changed, 43 insertions, 258 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 68fa2e4..2873ec6 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -2386,7 +2386,7 @@ each locale. --> Manage plug-in blocking... </message> <message name="IDS_BLOCKED_PLUGINS_LOAD_ALL" desc="Button to load all blocked plugins on a page, displayed in bubble when a page tries to display plug-ins."> - Run all plug-ins this time + Load all plug-ins on this page </message> <!-- SSL error strings --> @@ -3757,12 +3757,6 @@ Keep your key file in a safe place. You will need it to create new versions of y <message name="IDS_PLUGIN_LOAD" desc="The link for loading a blocked plug-in."> Run plug-in this time </message> - <message name="IDS_PLUGIN_LOAD_SHORT" desc="The link for loading a blocked plug-in."> - Run this time - </message> - <message name="IDS_PLUGIN_UPDATE" desc="The link for updating an outdated plug-in."> - Update plug-in - </message> <!-- Session Crashed Info Bar--> <message name="IDS_SESSION_CRASHED_VIEW_RESTORE_BUTTON" desc="Title of the restore button in the session crashed view."> @@ -6512,12 +6506,6 @@ Keep your key file in a safe place. You will need it to create new versions of y <message name="IDS_PLUGIN_BLOCKED_PROMPT" desc="Info Bar message when a non-sandboxed plugin was blocked"> The <ph name="PLUGIN_NAME">$1<ex>Flash</ex></ph> plug-in was blocked on this site because it could access your computer directly. </message> - <message name="IDS_PLUGIN_OUTDATED_PROMPT" desc="Info Bar message when an outdated plugin was disabled"> - The <ph name="PLUGIN_NAME">$1<ex>Flash</ex></ph> plug-in was disabled on this site because it is outdated and could access your computer directly. - </message> - <message name="IDS_PLUGIN_ENABLE_TEMPORARILY" desc="Info Bar button to temporarily re-enable a disabled plugin"> - Re-enable for this session - </message> <message name="IDS_PLUGIN_CRASHED_PROMPT" desc="Info Bar message to notify about a crashed plugin"> The following plug-in has crashed: <ph name="PLUGIN_NAME">$1<ex>Shockwave</ex></ph> </message> diff --git a/chrome/browser/blocked_plugin_manager.cc b/chrome/browser/blocked_plugin_manager.cc index 92b7c91..e0290c5 100644 --- a/chrome/browser/blocked_plugin_manager.cc +++ b/chrome/browser/blocked_plugin_manager.cc @@ -31,7 +31,7 @@ int BlockedPluginManager::GetButtons() const { std::wstring BlockedPluginManager::GetButtonLabel(InfoBarButton button) const { if (button == BUTTON_OK) - return l10n_util::GetString(IDS_PLUGIN_LOAD_SHORT); + return l10n_util::GetString(IDS_PLUGIN_LOAD); return ConfirmInfoBarDelegate::GetButtonLabel(button); } diff --git a/chrome/browser/plugin_service.cc b/chrome/browser/plugin_service.cc index fb15c54..c87f3fd 100644 --- a/chrome/browser/plugin_service.cc +++ b/chrome/browser/plugin_service.cc @@ -63,11 +63,6 @@ void PluginService::InitGlobalInstance(Profile* profile) { // We first group the plugins and then figure out which groups to disable. plugin_updater::DisablePluginGroupsFromPrefs(profile); - if (CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisableOutdatedPlugins)) { - plugin_updater::DisableOutdatedPluginGroups(); - } - // Have Chrome plugins write their data to the profile directory. GetInstance()->SetChromePluginDataDir(profile->GetPath()); } diff --git a/chrome/browser/plugin_updater.cc b/chrome/browser/plugin_updater.cc index 90a8daa..03846aa 100644 --- a/chrome/browser/plugin_updater.cc +++ b/chrome/browser/plugin_updater.cc @@ -7,7 +7,6 @@ #include <string> #include <vector> -#include "base/command_line.h" #include "base/path_service.h" #include "base/scoped_ptr.h" #include "base/values.h" @@ -15,7 +14,6 @@ #include "chrome/browser/pref_service.h" #include "chrome/browser/profile.h" #include "chrome/common/chrome_paths.h" -#include "chrome/common/chrome_switches.h" #include "chrome/common/plugin_group.h" #include "chrome/common/pref_names.h" #include "webkit/glue/plugins/plugin_list.h" @@ -209,19 +207,6 @@ void DisablePluginGroupsFromPrefs(Profile* profile) { } } -void DisableOutdatedPluginGroups() { - std::vector<linked_ptr<PluginGroup> > groups; - GetPluginGroups(&groups); - for (std::vector<linked_ptr<PluginGroup> >::iterator it = - groups.begin(); - it != groups.end(); - ++it) { - if ((*it)->IsVulnerable()) { - (*it)->Enable(false); - } - } -} - void UpdatePreferences(Profile* profile) { ListValue* plugins_list = profile->GetPrefs()->GetMutableList( prefs::kPluginsPluginsList); @@ -249,9 +234,7 @@ void UpdatePreferences(Profile* profile) { it != plugin_groups.end(); ++it) { // Don't save preferences for vulnerable pugins. - if (!CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisableOutdatedPlugins) || - !(*it)->IsVulnerable()) { + if (!(*it)->IsVulnerable()) { plugins_list->Append((*it)->GetSummary()); } } diff --git a/chrome/browser/plugin_updater.h b/chrome/browser/plugin_updater.h index b847162..f294ce4 100644 --- a/chrome/browser/plugin_updater.h +++ b/chrome/browser/plugin_updater.h @@ -28,11 +28,6 @@ void EnablePluginFile(bool enable, const FilePath::StringType& file_path); // Disable all plugin groups as defined by the user's preference file. void DisablePluginGroupsFromPrefs(Profile* profile); -// Disable all plugins groups that are known to be outdated, according to the -// information hardcoded in PluginGroup, to make sure that they can't be loaded -// on a web page and instead show a UI to update to the latest version. -void DisableOutdatedPluginGroups(); - // Write the enable/disable status to the user's preference file. void UpdatePreferences(Profile* profile); diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index 757219b..95cb7d4 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -574,7 +574,6 @@ void BrowserRenderProcessHost::PropagateBrowserCommandLineToRenderer( switches::kRemoteShellPort, switches::kEnablePepperTesting, switches::kBlockNonSandboxedPlugins, - switches::kDisableOutdatedPlugins, switches::kEnableRemoting, switches::kEnableClickToPlay, switches::kPrelaunchGpuProcess, diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc index 7a6958b..6089f2a 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -802,8 +802,6 @@ void RenderViewHost::OnMessageReceived(const IPC::Message& msg) { IPC_MESSAGE_HANDLER(ViewHostMsg_BlockedPluginLoaded, OnBlockedPluginLoaded); IPC_MESSAGE_HANDLER(ViewHostMsg_CrashedPlugin, OnCrashedPlugin); - IPC_MESSAGE_HANDLER(ViewHostMsg_DisabledOutdatedPlugin, - OnDisabledOutdatedPlugin); IPC_MESSAGE_HANDLER(ViewHostMsg_SendCurrentPageAllSavableResourceLinks, OnReceivedSavableResourceLinksForCurrentPage); IPC_MESSAGE_HANDLER(ViewHostMsg_SendSerializedHtmlData, @@ -1559,14 +1557,6 @@ void RenderViewHost::OnCrashedPlugin(const FilePath& plugin_path) { integration_delegate->OnCrashedPlugin(plugin_path); } -void RenderViewHost::OnDisabledOutdatedPlugin(const string16& name, - const GURL& update_url) { - RenderViewHostDelegate::BrowserIntegration* integration_delegate = - delegate_->GetBrowserIntegrationDelegate(); - if (integration_delegate) - integration_delegate->OnDisabledOutdatedPlugin(name, update_url); -} - void RenderViewHost::GetAllSavableResourceLinksForCurrentPage( const GURL& page_url) { Send(new ViewMsg_GetAllSavableResourceLinksForCurrentPage(routing_id(), diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h index 10a86b4..0dbb82e 100644 --- a/chrome/browser/renderer_host/render_view_host.h +++ b/chrome/browser/renderer_host/render_view_host.h @@ -600,7 +600,6 @@ class RenderViewHost : public RenderWidgetHost { void OnNonSandboxedPluginBlocked(const string16& name); void OnBlockedPluginLoaded(); void OnCrashedPlugin(const FilePath& plugin_path); - void OnDisabledOutdatedPlugin(const string16& name, const GURL& update_url); void OnReceivedSavableResourceLinksForCurrentPage( const std::vector<GURL>& resources_list, diff --git a/chrome/browser/renderer_host/render_view_host_delegate.h b/chrome/browser/renderer_host/render_view_host_delegate.h index ca13233..a1fb979 100644 --- a/chrome/browser/renderer_host/render_view_host_delegate.h +++ b/chrome/browser/renderer_host/render_view_host_delegate.h @@ -244,9 +244,6 @@ class RenderViewHostDelegate { // Notification that a worker process has crashed. virtual void OnCrashedWorker() = 0; - virtual void OnDisabledOutdatedPlugin(const string16& name, - const GURL& update_url) = 0; - // Notification that a request for install info has completed. virtual void OnDidGetApplicationInfo( int32 page_id, diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index 96c2411..2992612 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -236,68 +236,6 @@ void MakeNavigateParams(const NavigationController& controller, params->request_time = base::Time::Now(); } -class DisabledPluginInfoBar : public ConfirmInfoBarDelegate { - public: - DisabledPluginInfoBar(TabContents* tab_contents, - const string16& name, - const GURL& update_url) - : ConfirmInfoBarDelegate(tab_contents), - tab_contents_(tab_contents), - name_(name), - update_url_(update_url) { - tab_contents->AddInfoBar(this); - } - - virtual int GetButtons() const { - return BUTTON_OK | BUTTON_CANCEL | BUTTON_OK_DEFAULT; - } - - virtual std::wstring GetButtonLabel(InfoBarButton button) const { - if (button == BUTTON_CANCEL) - return l10n_util::GetString(IDS_PLUGIN_ENABLE_TEMPORARILY); - if (button == BUTTON_OK) - return l10n_util::GetString(IDS_PLUGIN_UPDATE); - return ConfirmInfoBarDelegate::GetButtonLabel(button); - } - - virtual std::wstring GetMessageText() const { - return UTF16ToWide(l10n_util::GetStringFUTF16(IDS_PLUGIN_OUTDATED_PROMPT, - name_)); - } - - virtual std::wstring GetLinkText() { - return l10n_util::GetString(IDS_LEARN_MORE); - } - - virtual SkBitmap* GetIcon() const { - return ResourceBundle::GetSharedInstance().GetBitmapNamed( - IDR_INFOBAR_PLUGIN_INSTALL); - } - - virtual bool Accept() { - tab_contents_->OpenURL(update_url_, GURL(), - CURRENT_TAB, PageTransition::LINK); - return false; - } - - virtual bool Cancel() { - tab_contents_->OpenURL(GURL(chrome::kChromeUIPluginsURL), GURL(), - CURRENT_TAB, PageTransition::LINK); - return false; - } - - virtual bool LinkClicked(WindowOpenDisposition disposition) { - // TODO(bauerb): Navigate to a help page explaining why we disabled - // the plugin, once we have one. - return false; - } - - private: - TabContents* tab_contents_; - string16 name_; - GURL update_url_; -}; - } // namespace // ----------------------------------------------------------------------------- @@ -2029,11 +1967,6 @@ void TabContents::OnDidGetApplicationInfo( delegate()->OnDidGetApplicationInfo(this, page_id); } -void TabContents::OnDisabledOutdatedPlugin(const string16& name, - const GURL& update_url) { - new DisabledPluginInfoBar(this, name, update_url); -} - void TabContents::OnPageContents(const GURL& url, int renderer_process_id, int32 page_id, diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h index ab4cf56..3511b7c 100644 --- a/chrome/browser/tab_contents/tab_contents.h +++ b/chrome/browser/tab_contents/tab_contents.h @@ -834,8 +834,6 @@ class TabContents : public PageNavigator, virtual void OnDidGetApplicationInfo( int32 page_id, const webkit_glue::WebApplicationInfo& info); - virtual void OnDisabledOutdatedPlugin(const string16& name, - const GURL& update_url); virtual void OnPageContents(const GURL& url, int renderer_process_id, int32 page_id, diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index cf12f1c..454fffd 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -184,9 +184,6 @@ const char kDisableLogging[] = "disable-logging"; // notification. const char kDisableNewTabFirstRun[] = "disable-new-tab-first-run"; -// Prevent outdated plugins from running. -const char kDisableOutdatedPlugins[] = "disable-outdated-plugins"; - // Prevent plugins from running. const char kDisablePlugins[] = "disable-plugins"; diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index b8f1255..cc69770 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -67,7 +67,6 @@ extern const char kDisableJava[]; extern const char kDisableLocalStorage[]; extern const char kDisableLogging[]; extern const char kDisableNewTabFirstRun[]; -extern const char kDisableOutdatedPlugins[]; extern const char kDisablePlugins[]; extern const char kDisablePopupBlocking[]; extern const char kDisablePromptOnRepost[]; diff --git a/chrome/common/plugin_group.h b/chrome/common/plugin_group.h index d4db0fc..7990038 100644 --- a/chrome/common/plugin_group.h +++ b/chrome/common/plugin_group.h @@ -28,13 +28,9 @@ struct PluginGroupDefinition { const char* update_url; // Location of latest secure version. }; -// A PluginGroup can match a range of versions of a specific plugin (as defined -// by matching a substring of its name). -// It contains all WebPluginInfo structs (at least one) matching its definition. -// In addition, it knows about a security "baseline", i.e. the minimum version -// of a plugin that is needed in order not to exhibit known security -// vulnerabilities. +// A PluginGroup contains at least one WebPluginInfo. +// In addition, it knows if the plugin is critically vulnerable. class PluginGroup { public: // Creates a PluginGroup from a PluginGroupDefinition. @@ -45,9 +41,7 @@ class PluginGroup { // definition is found. static PluginGroup* FromWebPluginInfo(const WebPluginInfo& wpi); - // Find a plugin group matching |info| in the list of hardcoded plugins and - // returns a copy of it if found, or a new group matching exactly this plugin - // otherwise. + // Find a plugin group matching |info| in the list of hardcoded plugins. static PluginGroup* FindHardcodedPluginGroup(const WebPluginInfo& info); // Configures the set of plugin names that are disabled by policy. diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index a9efdc8..ce787dd 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -1696,11 +1696,6 @@ IPC_BEGIN_MESSAGES(ViewHost) IPC_MESSAGE_ROUTED1(ViewHostMsg_CrashedPlugin, FilePath /* plugin_path */) - // Notifies when a plugin couldn't be loaded because it's outdated. - IPC_MESSAGE_ROUTED2(ViewHostMsg_DisabledOutdatedPlugin, - string16, /* name */ - GURL /* update_url */) - // Displays a JavaScript out-of-memory message in the infobar. IPC_MESSAGE_ROUTED0(ViewHostMsg_JSOutOfMemory) diff --git a/chrome/renderer/blocked_plugin.cc b/chrome/renderer/blocked_plugin.cc index b3c0973..c6433c3 100644 --- a/chrome/renderer/blocked_plugin.cc +++ b/chrome/renderer/blocked_plugin.cc @@ -10,7 +10,6 @@ #include "base/string_piece.h" #include "chrome/common/jstemplate_builder.h" #include "chrome/common/notification_service.h" -#include "chrome/common/plugin_group.h" #include "chrome/common/render_messages.h" #include "chrome/renderer/render_view.h" #include "grit/generated_resources.h" @@ -34,8 +33,7 @@ static const char* const kBlockedPluginDataURL = "chrome://blockedplugindata/"; BlockedPlugin::BlockedPlugin(RenderView* render_view, WebFrame* frame, - const WebPluginParams& params, - PluginGroup* group) + const WebPluginParams& params) : render_view_(render_view), frame_(frame), plugin_params_(params) { @@ -51,19 +49,15 @@ BlockedPlugin::BlockedPlugin(RenderView* render_view, DCHECK(!template_html.empty()) << "unable to load template. ID: " << resource_id; - DictionaryValue values; - values.SetString(L"loadPlugin", + DictionaryValue localized_strings; + localized_strings.SetString(L"loadPlugin", l10n_util::GetStringUTF16(IDS_PLUGIN_LOAD)); - values.SetString(L"updatePlugin", - l10n_util::GetStringUTF16(IDS_PLUGIN_UPDATE)); - values.SetString(L"message", + localized_strings.SetString(L"message", l10n_util::GetStringUTF16(IDS_BLOCKED_PLUGINS_TITLE)); - if (group) - values.Set(L"pluginGroup", group->GetDataForUI()); // "t" is the id of the templates root node. std::string htmlData = jstemplate_builder::GetTemplatesHtml( - template_html, &values, "t"); + template_html, &localized_strings, "t"); web_view->mainFrame()->loadHTMLString(htmlData, GURL(kBlockedPluginDataURL)); @@ -76,7 +70,6 @@ BlockedPlugin::BlockedPlugin(RenderView* render_view, void BlockedPlugin::BindWebFrame(WebFrame* frame) { BindToJavascript(frame, L"plugin"); BindMethod("load", &BlockedPlugin::Load); - BindMethod("update", &BlockedPlugin::Update); } void BlockedPlugin::WillDestroyPlugin() { @@ -97,23 +90,6 @@ void BlockedPlugin::Load(const CppArgumentList& args, CppVariant* result) { LoadPlugin(); } -void BlockedPlugin::Update(const CppArgumentList& args, CppVariant* result) { - if (args.size() > 0) { - CppVariant arg(args[0]); - if (arg.isString()) { - GURL url(arg.ToString()); - OpenURL(url); - } - } -} - -void BlockedPlugin::OpenURL(GURL& url) { - render_view_->Send(new ViewHostMsg_OpenURL(render_view_->routing_id(), - url, - GURL(), - CURRENT_TAB)); -} - void BlockedPlugin::LoadPlugin() { CHECK(plugin_); WebPluginContainer* container = plugin_->container(); diff --git a/chrome/renderer/blocked_plugin.h b/chrome/renderer/blocked_plugin.h index 40a601d..014c489 100644 --- a/chrome/renderer/blocked_plugin.h +++ b/chrome/renderer/blocked_plugin.h @@ -11,8 +11,6 @@ #include "webkit/glue/cpp_bound_class.h" #include "webkit/glue/plugins/webview_plugin.h" -class GURL; -class PluginGroup; class RenderView; class BlockedPlugin : public CppBoundClass, @@ -21,8 +19,10 @@ class BlockedPlugin : public CppBoundClass, public: BlockedPlugin(RenderView* render_view, WebKit::WebFrame* frame, - const WebKit::WebPluginParams& params, - PluginGroup* group); + const WebKit::WebPluginParams& params); + + void Load(const CppArgumentList& args, CppVariant* result); + void LoadPlugin(); WebViewPlugin* plugin() { return plugin_; } @@ -38,22 +38,6 @@ class BlockedPlugin : public CppBoundClass, private: virtual ~BlockedPlugin() { } - // Javascript callbacks: - // Load the blocked plugin by calling LoadPlugin() below. - // Takes no arguments, and returns nothing. - void Load(const CppArgumentList& args, CppVariant* result); - - // Update an outdated plugin. Takes one argument, the URL to download the - // latest version, and returns nothing. - void Update(const CppArgumentList& args, CppVariant* result); - - // Tells the browser to navigate to |url| (to download the latest version of - // the plugin there). - void OpenURL(GURL& url); - - // Load the blocked plugin. - void LoadPlugin(); - RenderView* render_view_; WebKit::WebFrame* frame_; WebKit::WebPluginParams plugin_params_; diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index f4f5c86..6a8f8e8 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -34,7 +34,6 @@ #include "chrome/common/notification_service.h" #include "chrome/common/page_zoom.h" #include "chrome/common/pepper_plugin_registry.h" -#include "chrome/common/plugin_group.h" #include "chrome/common/render_messages.h" #include "chrome/common/renderer_preferences.h" #include "chrome/common/thumbnail_score.h" @@ -2237,30 +2236,15 @@ WebPlugin* RenderView::createPlugin(WebFrame* frame, &info, &actual_mime_type)); - if (!found) - return NULL; - - scoped_ptr<PluginGroup> group(PluginGroup::FindHardcodedPluginGroup(info)); - group->AddPlugin(info, 0); - - if (!info.enabled) { - if (CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisableOutdatedPlugins) && - group->IsVulnerable()) { - Send(new ViewHostMsg_DisabledOutdatedPlugin(routing_id_, - group->GetGroupName(), - GURL(group->GetUpdateURL()))); - return CreatePluginPlaceholder(frame, params, group.get()); - } + if (!found || !info.enabled) return NULL; - } if (info.path.value() != kDefaultPluginLibraryName) { if (!AllowContentType(CONTENT_SETTINGS_TYPE_PLUGINS)) { DCHECK(CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableClickToPlay)); didNotAllowPlugins(frame); - return CreatePluginPlaceholder(frame, params, NULL); + return CreatePluginPlaceholder(frame, params); } scoped_refptr<pepper::PluginModule> pepper_module = PepperPluginRegistry::GetInstance()->GetModule(info.path); @@ -2268,9 +2252,8 @@ WebPlugin* RenderView::createPlugin(WebFrame* frame, return CreatePepperPlugin(frame, params, info.path, pepper_module.get()); if (CommandLine::ForCurrentProcess()->HasSwitch( switches::kBlockNonSandboxedPlugins)) { - Send(new ViewHostMsg_NonSandboxedPluginBlocked(routing_id_, - group->GetGroupName())); - return CreatePluginPlaceholder(frame, params, NULL); + Send(new ViewHostMsg_NonSandboxedPluginBlocked(routing_id_, info.name)); + return CreatePluginPlaceholder(frame, params); } } return CreateNPAPIPlugin(frame, params, info.path, actual_mime_type); @@ -3763,13 +3746,11 @@ WebPlugin* RenderView::CreateNPAPIPlugin(WebFrame* frame, } WebPlugin* RenderView::CreatePluginPlaceholder(WebFrame* frame, - const WebPluginParams& params, - PluginGroup* group) { + const WebPluginParams& params) { // |blocked_plugin| will delete itself when the WebViewPlugin is destroyed. - BlockedPlugin* blocked_plugin = new BlockedPlugin(this, frame, params, group); + BlockedPlugin* blocked_plugin = new BlockedPlugin(this, frame, params); WebViewPlugin* plugin = blocked_plugin->plugin(); - WebView* web_view = plugin->web_view(); - webkit_preferences_.Apply(web_view); + webkit_preferences_.Apply(plugin->web_view()); return plugin; } diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index f31d27e..1834ba1 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -64,7 +64,6 @@ class ListValue; class NavigationState; class NotificationProvider; class PepperDeviceTest; -class PluginGroup; class PrintWebViewHelper; class RenderViewVisitor; class SkBitmap; @@ -869,8 +868,7 @@ class RenderView : public RenderWidget, // Create a new placeholder for a blocked plugin. WebKit::WebPlugin* CreatePluginPlaceholder( WebKit::WebFrame* frame, - const WebKit::WebPluginParams& params, - PluginGroup* group); + const WebKit::WebPluginParams& params); // Sends an IPC notification that the specified content type was blocked. void DidBlockContentType(ContentSettingsType settings_type); diff --git a/chrome/renderer/resources/blocked_plugin.html b/chrome/renderer/resources/blocked_plugin.html index b643b4d..4310e98 100644 --- a/chrome/renderer/resources/blocked_plugin.html +++ b/chrome/renderer/resources/blocked_plugin.html @@ -1,26 +1,12 @@ <!DOCTYPE html> <html> <head> -<script> -function debug(msg) { - document.getElementById('debug').textContent = msg; -} - -function bodyClicked() { - var group = templateData.pluginGroup; - if (group) { - plugin.update(group.update_url); - } else { - plugin.load(); - } -} -</script> <style> body { - background-color: rgb(252, 235, 162); - margin: 0; - text-align: center; - font-family: sans-serif; + background-color: rgb(252, 235, 162); + margin: 0; + text-align: center; + font-family: sans-serif; } h1 { @@ -30,7 +16,7 @@ h1 { } #outer:hover h1 { - text-decoration: underline; + text-decoration: underline; } p { @@ -39,32 +25,32 @@ p { } #outer { - width: 100%; - height: 100%; - cursor: pointer; - position: absolute; + width: 100%; + height: 100%; + cursor: pointer; + position: absolute; } #inner { - position: relative; - top: 50%; - margin-top: -50px; + position: relative; + top: 50%; + margin-top: -50px; } #top, #bottom, #left, #right { - background: black; - position: fixed; + background: black; + position: fixed; } #left, #right { - top: 0; bottom: 0; - width: 1px; + top: 0; bottom: 0; + width: 1px; } #left { left: 0; } #right { right: 0; } #top, #bottom { - left: 0; right: 0; - height: 1px; + left: 0; right: 0; + height: 1px; } #top { top: 0; } #bottom { bottom: 0; } @@ -72,17 +58,15 @@ p { </head> <body id="t"> -<div id="outer" onclick="bodyClicked()"> +<div id="outer" onclick="plugin.load()"> <div id="left"></div> <div id="right"></div> <div id="top"></div> <div id="bottom"></div> <div id="inner"> <div><img src="../../app/theme/extensions_section.png" /></div> -<h1 jsdisplay="!hasOwnProperty('pluginGroup') || !pluginGroup.critical" i18n-content="loadPlugin">PLUGIN_LOAD</h1> -<h1 jsdisplay="hasOwnProperty('pluginGroup')" i18n-content="updatePlugin">UPDATE_PLUGIN</h1> +<h1 i18n-content="loadPlugin">PLUGIN_LOAD</h1> <p><span class="help" i18n-content="message">BLOCKED_PLUGINS_TITLE</span></p> -<p id="debug"> </p> </div> </div> </body> |