diff options
author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-12 16:14:22 +0000 |
---|---|---|
committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-12 16:14:22 +0000 |
commit | 6b3db4350e3cb5b7d5ef9ff5995f5dcfe9bac6e9 (patch) | |
tree | bde9dde95d828715441bb818cf78397846ef32c7 /chrome/browser/blocked_plugin_manager.cc | |
parent | 3c5ce41e6cb80f816e7d398594d77e2c6b03a22a (diff) | |
download | chromium_src-6b3db4350e3cb5b7d5ef9ff5995f5dcfe9bac6e9.zip chromium_src-6b3db4350e3cb5b7d5ef9ff5995f5dcfe9bac6e9.tar.gz chromium_src-6b3db4350e3cb5b7d5ef9ff5995f5dcfe9bac6e9.tar.bz2 |
Revert 55888: Allow per-plugin content settings.
Run with --enable-resource-content-settings and --enable-click-to-play to enable.
TabSpecificContentSettings now keeps track of which resources were blocked. The content setting bubble displays those resource, and selecting the "allow radio buttons adds exceptions for these resources.
The infobar for non-sandboxed plug-ins now also shows a button to always allow the blocked plug-in on that site.
Screenshot of the plugin bubble: http://imgur.com/6npqv.png
Because we need to change the title and radio button labels depending on whether we track specific plug-ins, we copy them from the ContentSettingBubbleModel.
XIB changes: Add a text field for the blocked plug-ins to ContentBlockedPlugins.xib, hooked up to the |blockedResourcesField_| outlet.
BUG=39252,38432
TEST=manual
Review URL: http://codereview.chromium.org/2873104
TBR: bauerb@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55891 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/blocked_plugin_manager.cc')
-rw-r--r-- | chrome/browser/blocked_plugin_manager.cc | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/chrome/browser/blocked_plugin_manager.cc b/chrome/browser/blocked_plugin_manager.cc index b073b1f..92b7c91 100644 --- a/chrome/browser/blocked_plugin_manager.cc +++ b/chrome/browser/blocked_plugin_manager.cc @@ -6,13 +6,9 @@ #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/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" @@ -20,10 +16,7 @@ BlockedPluginManager::BlockedPluginManager(TabContents* tab_contents) : ConfirmInfoBarDelegate(tab_contents), tab_contents_(tab_contents) { } -void BlockedPluginManager::OnNonSandboxedPluginBlocked( - const std::string& plugin, - const string16& name) { - plugin_ = plugin; +void BlockedPluginManager::OnNonSandboxedPluginBlocked(const string16& name) { name_ = name; tab_contents_->AddInfoBar(this); } @@ -33,18 +26,12 @@ void BlockedPluginManager::OnBlockedPluginLoaded() { } int BlockedPluginManager::GetButtons() const { - int buttons = BUTTON_OK; - if (CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableResourceContentSettings)) - buttons |= BUTTON_CANCEL; - return buttons; + return BUTTON_OK; } std::wstring BlockedPluginManager::GetButtonLabel(InfoBarButton button) const { if (button == BUTTON_OK) return l10n_util::GetString(IDS_PLUGIN_LOAD_SHORT); - if (button == BUTTON_CANCEL) - return l10n_util::GetString(IDS_BLOCKED_PLUGINS_UNBLOCK_SHORT); return ConfirmInfoBarDelegate::GetButtonLabel(button); } @@ -67,16 +54,6 @@ bool BlockedPluginManager::Accept() { return true; } -bool BlockedPluginManager::Cancel() { - DCHECK(CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableResourceContentSettings)); - tab_contents_->profile()->GetHostContentSettingsMap()->AddExceptionForURL( - tab_contents_->GetURL(), CONTENT_SETTINGS_TYPE_PLUGINS, plugin_, - CONTENT_SETTING_ALLOW); - tab_contents_->render_view_host()->LoadBlockedPlugins(); - return true; -} - bool BlockedPluginManager::LinkClicked(WindowOpenDisposition disposition) { // TODO(bauerb): Navigate to a help page explaining why we blocked the plugin, // once we have one. |