diff options
author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-09 21:00:49 +0000 |
---|---|---|
committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-09 21:00:49 +0000 |
commit | 51ffaf742c78f2fdd9833167c5534d8009873751 (patch) | |
tree | acad7cf4038f246d01dd5852050cac7bd67b5aaf /chrome/browser | |
parent | aaaab841d2e79745eb9e24ad873237509557fb53 (diff) | |
download | chromium_src-51ffaf742c78f2fdd9833167c5534d8009873751.zip chromium_src-51ffaf742c78f2fdd9833167c5534d8009873751.tar.gz chromium_src-51ffaf742c78f2fdd9833167c5534d8009873751.tar.bz2 |
Load only blocked plug-ins when allowing plug-ins from infobars.
BUG=126418
TEST=see bug for manual test
Review URL: https://chromiumcodereview.appspot.com/10384038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136123 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/automation/testing_automation_provider.cc | 3 | ||||
-rw-r--r-- | chrome/browser/plugin_infobar_delegates.cc | 17 | ||||
-rw-r--r-- | chrome/browser/plugin_infobar_delegates.h | 11 | ||||
-rw-r--r-- | chrome/browser/plugin_observer.cc | 6 | ||||
-rw-r--r-- | chrome/browser/plugin_observer.h | 3 | ||||
-rw-r--r-- | chrome/browser/ui/content_settings/content_setting_bubble_model.cc | 4 |
6 files changed, 30 insertions, 14 deletions
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index ea91a5e..320d431 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -7132,7 +7132,8 @@ void TestingAutomationProvider::LoadBlockedPlugins(int tab_handle, if (!contents) return; RenderViewHost* host = contents->GetRenderViewHost(); - host->Send(new ChromeViewMsg_LoadBlockedPlugins(host->GetRoutingID())); + host->Send(new ChromeViewMsg_LoadBlockedPlugins(host->GetRoutingID(), + std::string())); *success = true; } } diff --git a/chrome/browser/plugin_infobar_delegates.cc b/chrome/browser/plugin_infobar_delegates.cc index 084e4f9..e8a94ba 100644 --- a/chrome/browser/plugin_infobar_delegates.cc +++ b/chrome/browser/plugin_infobar_delegates.cc @@ -31,9 +31,11 @@ using content::Referrer; using content::UserMetricsAction; PluginInfoBarDelegate::PluginInfoBarDelegate(InfoBarTabHelper* infobar_helper, - const string16& name) + const string16& name, + const std::string& identifier) : ConfirmInfoBarDelegate(infobar_helper), - name_(name) { + name_(name), + identifier_(identifier) { } PluginInfoBarDelegate::~PluginInfoBarDelegate() { @@ -50,7 +52,8 @@ bool PluginInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { } void PluginInfoBarDelegate::LoadBlockedPlugins() { - owner()->Send(new ChromeViewMsg_LoadBlockedPlugins(owner()->routing_id())); + owner()->Send( + new ChromeViewMsg_LoadBlockedPlugins(owner()->routing_id(), identifier_)); } gfx::Image* PluginInfoBarDelegate::GetIcon() const { @@ -67,8 +70,9 @@ string16 PluginInfoBarDelegate::GetLinkText() const { UnauthorizedPluginInfoBarDelegate::UnauthorizedPluginInfoBarDelegate( InfoBarTabHelper* infobar_helper, HostContentSettingsMap* content_settings, - const string16& utf16_name) - : PluginInfoBarDelegate(infobar_helper, utf16_name), + const string16& utf16_name, + const std::string& identifier) + : PluginInfoBarDelegate(infobar_helper, utf16_name, identifier), content_settings_(content_settings) { content::RecordAction(UserMetricsAction("BlockedPluginInfobar.Shown")); std::string name = UTF16ToUTF8(utf16_name); @@ -165,7 +169,8 @@ OutdatedPluginInfoBarDelegate::OutdatedPluginInfoBarDelegate( const string16& message) : PluginInfoBarDelegate( observer->tab_contents_wrapper()->infobar_tab_helper(), - installer->name()), + installer->name(), + installer->identifier()), WeakPluginInstallerObserver(installer), observer_(observer), message_(message) { diff --git a/chrome/browser/plugin_infobar_delegates.h b/chrome/browser/plugin_infobar_delegates.h index 355dc1f..cb0a4b8 100644 --- a/chrome/browser/plugin_infobar_delegates.h +++ b/chrome/browser/plugin_infobar_delegates.h @@ -20,7 +20,9 @@ class PluginObserver; // Base class for blocked plug-in infobars. class PluginInfoBarDelegate : public ConfirmInfoBarDelegate { public: - PluginInfoBarDelegate(InfoBarTabHelper* infobar_helper, const string16& name); + PluginInfoBarDelegate(InfoBarTabHelper* infobar_helper, + const string16& name, + const std::string& identifier); protected: virtual ~PluginInfoBarDelegate(); @@ -39,6 +41,8 @@ class PluginInfoBarDelegate : public ConfirmInfoBarDelegate { virtual gfx::Image* GetIcon() const OVERRIDE; virtual string16 GetLinkText() const OVERRIDE; + std::string identifier_; + DISALLOW_COPY_AND_ASSIGN(PluginInfoBarDelegate); }; @@ -46,8 +50,9 @@ class PluginInfoBarDelegate : public ConfirmInfoBarDelegate { class UnauthorizedPluginInfoBarDelegate : public PluginInfoBarDelegate { public: UnauthorizedPluginInfoBarDelegate(InfoBarTabHelper* infobar_helper, - HostContentSettingsMap* content_settings, - const string16& name); + HostContentSettingsMap* content_settings, + const string16& name, + const std::string& identifier); private: virtual ~UnauthorizedPluginInfoBarDelegate(); diff --git a/chrome/browser/plugin_observer.cc b/chrome/browser/plugin_observer.cc index 34a708d..1b3e333 100644 --- a/chrome/browser/plugin_observer.cc +++ b/chrome/browser/plugin_observer.cc @@ -209,13 +209,15 @@ bool PluginObserver::OnMessageReceived(const IPC::Message& message) { return true; } -void PluginObserver::OnBlockedUnauthorizedPlugin(const string16& name) { +void PluginObserver::OnBlockedUnauthorizedPlugin( + const string16& name, + const std::string& identifier) { InfoBarTabHelper* infobar_helper = tab_contents_->infobar_tab_helper(); infobar_helper->AddInfoBar( new UnauthorizedPluginInfoBarDelegate( infobar_helper, tab_contents_->profile()->GetHostContentSettingsMap(), - name)); + name, identifier)); } void PluginObserver::OnBlockedOutdatedPlugin(int placeholder_id, diff --git a/chrome/browser/plugin_observer.h b/chrome/browser/plugin_observer.h index 0cde5e4..39287f2 100644 --- a/chrome/browser/plugin_observer.h +++ b/chrome/browser/plugin_observer.h @@ -41,7 +41,8 @@ class PluginObserver : public content::WebContentsObserver { private: class PluginPlaceholderHost; - void OnBlockedUnauthorizedPlugin(const string16& name); + void OnBlockedUnauthorizedPlugin(const string16& name, + const std::string& identifier); void OnBlockedOutdatedPlugin(int placeholder_id, const std::string& identifier); #if defined(ENABLE_PLUGIN_INSTALLATION) diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc index 4978542..49a0ca3 100644 --- a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc +++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc @@ -385,7 +385,9 @@ class ContentSettingPluginBubbleModel : public ContentSettingSingleRadioGroup { DCHECK(tab_contents()); content::RenderViewHost* host = tab_contents()->web_contents()->GetRenderViewHost(); - host->Send(new ChromeViewMsg_LoadBlockedPlugins(host->GetRoutingID())); + // TODO(bauerb): We should send the identifiers of blocked plug-ins here. + host->Send(new ChromeViewMsg_LoadBlockedPlugins(host->GetRoutingID(), + std::string())); set_custom_link_enabled(false); tab_contents()->content_settings()->set_load_plugins_link_enabled(false); } |