summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-12 20:38:58 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-12 20:38:58 +0000
commit2d498eec384907d4f2c411324d4341b85e31f12c (patch)
tree57df0898131c5cf7c1228537086a0a54019f315a
parent26f89e38c15a72ac67433b7c44a9996a6624d900 (diff)
downloadchromium_src-2d498eec384907d4f2c411324d4341b85e31f12c.zip
chromium_src-2d498eec384907d4f2c411324d4341b85e31f12c.tar.gz
chromium_src-2d498eec384907d4f2c411324d4341b85e31f12c.tar.bz2
Remove BlockedPluginManager entirely. It only existed to show infobars for blocked plugins, which it hasn't done since r62146, and there are no firm plans to do so in the future.
This is important because http://codereview.chromium.org/4767001/ is going to make calling RemoveInfoBar() with a non-showing delegate an error, and it seems better to just remove all this code if it's not doing anything than to neuter parts of it. BUG=62154 TEST=none Review URL: http://codereview.chromium.org/4863001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65984 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/generated_resources.grd9
-rw-r--r--chrome/browser/blocked_plugin_manager.cc91
-rw-r--r--chrome/browser/blocked_plugin_manager.h40
-rw-r--r--chrome/browser/renderer_host/render_view_host.cc22
-rw-r--r--chrome/browser/renderer_host/render_view_host.h3
-rw-r--r--chrome/browser/renderer_host/render_view_host_delegate.cc5
-rw-r--r--chrome/browser/renderer_host/render_view_host_delegate.h8
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc7
-rw-r--r--chrome/browser/tab_contents/tab_contents.h5
-rw-r--r--chrome/chrome_browser.gypi2
-rw-r--r--chrome/common/render_messages_internal.h10
-rw-r--r--chrome/renderer/blocked_plugin.cc2
12 files changed, 0 insertions, 204 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index a409a09..9216a324 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -2432,9 +2432,6 @@ each locale. -->
<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
</message>
- <message name="IDS_BLOCKED_PLUGINS_UNBLOCK_SHORT" desc="Button to unblock nonsandboxed plug-ins on a site">
- Always on this site
- </message>
<!-- SSL error strings -->
<message name="IDS_SEVERAL_SSL_ERRORS" desc="Bubble info header text when there is more than 1 error">
@@ -4203,9 +4200,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, displayed in the click-to-play UI.">
Click to run this plug-in
</message>
- <message name="IDS_PLUGIN_LOAD_SHORT" desc="The link for loading all blocked plug-ins, displayed in the infobar.">
- Allow
- </message>
<message name="IDS_PLUGIN_UPDATE" desc="The link for updating an outdated plug-in.">
Update plug-in...
</message>
@@ -7498,9 +7492,6 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_PLUGININSTALLER_PROBLEMSINSTALLING" desc="Infobar text for link to help center">
Problems installing?
</message>
- <message name="IDS_PLUGIN_BLOCKED_PROMPT" desc="Info Bar message when a non-sandboxed plugin was blocked">
- This website uses the <ph name="PLUGIN_NAME">$1<ex>Flash</ex></ph> plug-in; allow this plug-in to run?
- </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 because it is out of date.
</message>
diff --git a/chrome/browser/blocked_plugin_manager.cc b/chrome/browser/blocked_plugin_manager.cc
deleted file mode 100644
index 2da3653..0000000
--- a/chrome/browser/blocked_plugin_manager.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/blocked_plugin_manager.h"
-
-#include "app/l10n_util.h"
-#include "app/resource_bundle.h"
-#include "base/command_line.h"
-#include "base/utf_string_conversions.h"
-#include "chrome/browser/host_content_settings_map.h"
-#include "chrome/browser/metrics/user_metrics.h"
-#include "chrome/browser/profile.h"
-#include "chrome/browser/renderer_host/render_view_host.h"
-#include "chrome/browser/tab_contents/tab_contents.h"
-#include "chrome/common/chrome_switches.h"
-#include "grit/generated_resources.h"
-#include "grit/theme_resources.h"
-
-BlockedPluginManager::BlockedPluginManager(TabContents* tab_contents)
- : ConfirmInfoBarDelegate(tab_contents),
- tab_contents_(tab_contents) { }
-
-void BlockedPluginManager::OnNonSandboxedPluginBlocked(
- const std::string& plugin,
- const string16& name) {
- plugin_ = plugin;
- name_ = name;
- UserMetrics::RecordAction(UserMetricsAction("ClickToPlay_InfobarShown"));
- tab_contents_->AddInfoBar(this);
-}
-
-void BlockedPluginManager::OnBlockedPluginLoaded() {
- tab_contents_->RemoveInfoBar(this);
-}
-
-int BlockedPluginManager::GetButtons() const {
- int buttons = BUTTON_OK;
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableResourceContentSettings))
- buttons |= BUTTON_CANCEL;
- return buttons;
-}
-
-string16 BlockedPluginManager::GetButtonLabel(InfoBarButton button) const {
- if (button == BUTTON_OK)
- return l10n_util::GetStringUTF16(IDS_PLUGIN_LOAD_SHORT);
- if (button == BUTTON_CANCEL)
- return l10n_util::GetStringUTF16(IDS_BLOCKED_PLUGINS_UNBLOCK_SHORT);
- return ConfirmInfoBarDelegate::GetButtonLabel(button);
-}
-
-string16 BlockedPluginManager::GetMessageText() const {
- return l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_PROMPT, name_);
-}
-
-string16 BlockedPluginManager::GetLinkText() {
- return l10n_util::GetStringUTF16(IDS_LEARN_MORE);
-}
-
-SkBitmap* BlockedPluginManager::GetIcon() const {
- return ResourceBundle::GetSharedInstance().GetBitmapNamed(
- IDR_INFOBAR_PLUGIN_INSTALL);
-}
-
-bool BlockedPluginManager::Accept() {
- UserMetrics::RecordAction(UserMetricsAction("ClickToPlay_LoadAll_Infobar"));
- tab_contents_->render_view_host()->LoadBlockedPlugins();
- return true;
-}
-
-bool BlockedPluginManager::Cancel() {
- DCHECK(CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableResourceContentSettings));
- UserMetrics::RecordAction(UserMetricsAction("ClickToPlay_AllowAlways"));
- tab_contents_->profile()->GetHostContentSettingsMap()->AddExceptionForURL(
- tab_contents_->GetURL(), CONTENT_SETTINGS_TYPE_PLUGINS, plugin_,
- CONTENT_SETTING_ALLOW);
- tab_contents_->render_view_host()->LoadBlockedPlugins();
- return true;
-}
-
-void BlockedPluginManager::InfoBarDismissed() {
- UserMetrics::RecordAction(UserMetricsAction("ClickToPlay_Dismiss_Infobar"));
-}
-
-bool BlockedPluginManager::LinkClicked(WindowOpenDisposition disposition) {
- // TODO(bauerb): Navigate to a help page explaining why we blocked the plugin,
- // once we have one.
- return false;
-}
diff --git a/chrome/browser/blocked_plugin_manager.h b/chrome/browser/blocked_plugin_manager.h
deleted file mode 100644
index fcabdb2..0000000
--- a/chrome/browser/blocked_plugin_manager.h
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_BLOCKED_PLUGIN_MANAGER_H_
-#define CHROME_BROWSER_BLOCKED_PLUGIN_MANAGER_H_
-
-#include "chrome/browser/renderer_host/render_view_host_delegate.h"
-#include "chrome/browser/tab_contents/infobar_delegate.h"
-
-class TabContents;
-
-class BlockedPluginManager : public RenderViewHostDelegate::BlockedPlugin,
- public ConfirmInfoBarDelegate {
- public:
- explicit BlockedPluginManager(TabContents* tab_contents);
-
- virtual void OnNonSandboxedPluginBlocked(const std::string& plugin,
- const string16& name);
- virtual void OnBlockedPluginLoaded();
-
- // ConfirmInfoBarDelegate methods
- virtual int GetButtons() const;
- virtual string16 GetButtonLabel(InfoBarButton button) const;
- virtual string16 GetMessageText() const;
- virtual string16 GetLinkText();
- virtual SkBitmap* GetIcon() const;
- virtual bool Accept();
- virtual bool Cancel();
- virtual void InfoBarDismissed();
- virtual bool LinkClicked(WindowOpenDisposition disposition);
-
- private:
- // Owns us.
- TabContents* tab_contents_;
- string16 name_;
- std::string plugin_;
-};
-
-#endif // CHROME_BROWSER_BLOCKED_PLUGIN_MANAGER_H_
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index 134274e..aaebf9f 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -15,7 +15,6 @@
#include "base/string_util.h"
#include "base/time.h"
#include "base/values.h"
-#include "chrome/browser/blocked_plugin_manager.h"
#include "chrome/browser/browser_list.h"
#include "chrome/browser/child_process_security_policy.h"
#include "chrome/browser/cross_site_request_manager.h"
@@ -843,10 +842,6 @@ void RenderViewHost::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(ViewHostMsg_DevToolsRuntimePropertyChanged,
OnDevToolsRuntimePropertyChanged);
IPC_MESSAGE_HANDLER(ViewHostMsg_MissingPluginStatus, OnMissingPluginStatus);
- IPC_MESSAGE_HANDLER(ViewHostMsg_NonSandboxedPluginBlocked,
- OnNonSandboxedPluginBlocked);
- IPC_MESSAGE_HANDLER(ViewHostMsg_BlockedPluginLoaded,
- OnBlockedPluginLoaded);
IPC_MESSAGE_HANDLER(ViewHostMsg_CrashedPlugin, OnCrashedPlugin);
IPC_MESSAGE_HANDLER(ViewHostMsg_DisabledOutdatedPlugin,
OnDisabledOutdatedPlugin);
@@ -1620,23 +1615,6 @@ void RenderViewHost::OnMissingPluginStatus(int status) {
integration_delegate->OnMissingPluginStatus(status);
}
-void RenderViewHost::OnNonSandboxedPluginBlocked(const std::string& plugin,
- const string16& name) {
- RenderViewHostDelegate::BlockedPlugin* blocked_plugin_delegate =
- delegate_->GetBlockedPluginDelegate();
- if (blocked_plugin_delegate) {
- blocked_plugin_delegate->OnNonSandboxedPluginBlocked(plugin, name);
- }
-}
-
-void RenderViewHost::OnBlockedPluginLoaded() {
- RenderViewHostDelegate::BlockedPlugin* blocked_plugin_delegate =
- delegate_->GetBlockedPluginDelegate();
- if (blocked_plugin_delegate) {
- blocked_plugin_delegate->OnBlockedPluginLoaded();
- }
-}
-
void RenderViewHost::OnCrashedPlugin(const FilePath& plugin_path) {
RenderViewHostDelegate::BrowserIntegration* integration_delegate =
delegate_->GetBrowserIntegrationDelegate();
diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h
index efcf56c..97d1f5b 100644
--- a/chrome/browser/renderer_host/render_view_host.h
+++ b/chrome/browser/renderer_host/render_view_host.h
@@ -656,9 +656,6 @@ class RenderViewHost : public RenderWidgetHost {
void OnDevToolsRuntimePropertyChanged(const std::string& name,
const std::string& value);
void OnMissingPluginStatus(int status);
- void OnNonSandboxedPluginBlocked(const std::string& plugin,
- const string16& name);
- void OnBlockedPluginLoaded();
void OnCrashedPlugin(const FilePath& plugin_path);
void OnDisabledOutdatedPlugin(const string16& name, const GURL& update_url);
diff --git a/chrome/browser/renderer_host/render_view_host_delegate.cc b/chrome/browser/renderer_host/render_view_host_delegate.cc
index 2ca69c4..06ca550 100644
--- a/chrome/browser/renderer_host/render_view_host_delegate.cc
+++ b/chrome/browser/renderer_host/render_view_host_delegate.cc
@@ -69,11 +69,6 @@ RenderViewHostDelegate::GetBookmarkDragDelegate() {
return NULL;
}
-RenderViewHostDelegate::BlockedPlugin*
-RenderViewHostDelegate::GetBlockedPluginDelegate() {
- return NULL;
-}
-
RenderViewHostDelegate::SSL*
RenderViewHostDelegate::GetSSLDelegate() {
return NULL;
diff --git a/chrome/browser/renderer_host/render_view_host_delegate.h b/chrome/browser/renderer_host/render_view_host_delegate.h
index 670b5f1..020fadc 100644
--- a/chrome/browser/renderer_host/render_view_host_delegate.h
+++ b/chrome/browser/renderer_host/render_view_host_delegate.h
@@ -587,13 +587,6 @@ class RenderViewHostDelegate {
virtual ~BookmarkDrag() {}
};
- class BlockedPlugin {
- public:
- virtual void OnNonSandboxedPluginBlocked(const std::string& plugin,
- const string16& name) = 0;
- virtual void OnBlockedPluginLoaded() = 0;
- };
-
// SSL -----------------------------------------------------------------------
// Interface for UI and other RenderViewHost-specific interactions with SSL.
@@ -664,7 +657,6 @@ class RenderViewHostDelegate {
virtual Autocomplete* GetAutocompleteDelegate();
virtual AutoFill* GetAutoFillDelegate();
virtual BookmarkDrag* GetBookmarkDragDelegate();
- virtual BlockedPlugin* GetBlockedPluginDelegate();
virtual SSL* GetSSLDelegate();
virtual FileSelect* GetFileSelectDelegate();
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 6d6c575..d9522e1 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -24,7 +24,6 @@
#include "chrome/browser/autocomplete_history_manager.h"
#include "chrome/browser/autofill/autofill_manager.h"
#include "chrome/browser/blocked_content_container.h"
-#include "chrome/browser/blocked_plugin_manager.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_shutdown.h"
@@ -2313,12 +2312,6 @@ RenderViewHostDelegate::AutoFill* TabContents::GetAutoFillDelegate() {
return GetAutoFillManager();
}
-RenderViewHostDelegate::BlockedPlugin* TabContents::GetBlockedPluginDelegate() {
- if (blocked_plugin_manager_.get() == NULL)
- blocked_plugin_manager_.reset(new BlockedPluginManager(this));
- return blocked_plugin_manager_.get();
-}
-
RenderViewHostDelegate::SSL* TabContents::GetSSLDelegate() {
return GetSSLHelper();
}
diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h
index 0a79a83..937fe00 100644
--- a/chrome/browser/tab_contents/tab_contents.h
+++ b/chrome/browser/tab_contents/tab_contents.h
@@ -66,7 +66,6 @@ struct PasswordForm;
class AutocompleteHistoryManager;
class AutoFillManager;
class BlockedContentContainer;
-class BlockedPluginManager;
class DOMUI;
class DownloadItem;
class Extension;
@@ -931,7 +930,6 @@ class TabContents : public PageNavigator,
virtual RenderViewHostDelegate::FavIcon* GetFavIconDelegate();
virtual RenderViewHostDelegate::Autocomplete* GetAutocompleteDelegate();
virtual RenderViewHostDelegate::AutoFill* GetAutoFillDelegate();
- virtual RenderViewHostDelegate::BlockedPlugin* GetBlockedPluginDelegate();
virtual RenderViewHostDelegate::SSL* GetSSLDelegate();
virtual RenderViewHostDelegate::FileSelect* GetFileSelectDelegate();
virtual AutomationResourceRoutingDelegate*
@@ -1109,9 +1107,6 @@ class TabContents : public PageNavigator,
// TabContentsSSLHelper, lazily created.
scoped_ptr<TabContentsSSLHelper> ssl_helper_;
- // BlockedPluginManager, lazily created.
- scoped_ptr<BlockedPluginManager> blocked_plugin_manager_;
-
// FileSelectHelper, lazily created.
scoped_ptr<FileSelectHelper> file_select_helper_;
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index bb21546..ab4b969 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -272,8 +272,6 @@
'browser/background_mode_manager.h',
'browser/blocked_content_container.cc',
'browser/blocked_content_container.h',
- 'browser/blocked_plugin_manager.cc',
- 'browser/blocked_plugin_manager.h',
'browser/bookmarks/bookmark_codec.cc',
'browser/bookmarks/bookmark_codec.h',
'browser/bookmarks/bookmark_context_menu_controller.cc',
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index a4ac77f..d4f4132 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -1858,16 +1858,6 @@ IPC_BEGIN_MESSAGES(ViewHost)
IPC_MESSAGE_ROUTED1(ViewHostMsg_MissingPluginStatus,
int /* status */)
- // Notifies when a non-sandboxed plugin was blocked.
- // |plugin| is the identifier for the plugin (currently its path),
- // |name| is its user-visible name.
- IPC_MESSAGE_ROUTED2(ViewHostMsg_NonSandboxedPluginBlocked,
- std::string /* plugin */,
- string16 /* name */)
-
- // Notifies when a blocked plugin was loaded via click-to-load.
- IPC_MESSAGE_ROUTED0(ViewHostMsg_BlockedPluginLoaded)
-
// Sent by the renderer process to indicate that a plugin instance has
// crashed.
IPC_MESSAGE_ROUTED1(ViewHostMsg_CrashedPlugin,
diff --git a/chrome/renderer/blocked_plugin.cc b/chrome/renderer/blocked_plugin.cc
index b06fd55..eb259d8 100644
--- a/chrome/renderer/blocked_plugin.cc
+++ b/chrome/renderer/blocked_plugin.cc
@@ -98,7 +98,5 @@ void BlockedPlugin::LoadPlugin() {
container->reportGeometry();
plugin_->ReplayReceivedData(new_plugin);
plugin_->destroy();
- render_view_->Send(
- new ViewHostMsg_BlockedPluginLoaded(render_view_->routing_id()));
}
}