Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3271)

Unified Diff: chrome/browser/pepper_broker_infobar_delegate.cc

Issue 11488009: Add content settings page action for Pepper broker authorization. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/pepper_broker_infobar_delegate.cc
diff --git a/chrome/browser/pepper_broker_infobar_delegate.cc b/chrome/browser/pepper_broker_infobar_delegate.cc
index 3ef8edf877ee9d5f03b9956a652004ff664c78d2..5c1f0e5b43ce85b28a9160bc69f8925268b8b446 100644
--- a/chrome/browser/pepper_broker_infobar_delegate.cc
+++ b/chrome/browser/pepper_broker_infobar_delegate.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/pepper_broker_infobar_delegate.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
+#include "chrome/browser/content_settings/tab_specific_content_settings.h"
#include "chrome/browser/infobars/infobar_tab_helper.h"
#include "chrome/browser/plugins/plugin_finder.h"
#include "chrome/browser/plugins/plugin_metadata.h"
@@ -45,6 +46,8 @@ void PepperBrokerInfoBarDelegate::Show(
Profile* profile =
Profile::FromBrowserContext(web_contents->GetBrowserContext());
+ TabSpecificContentSettings* tab_content_settings =
+ TabSpecificContentSettings::FromWebContents(web_contents);
HostContentSettingsMap* content_settings =
profile->GetHostContentSettingsMap();
ContentSetting setting =
@@ -55,12 +58,14 @@ void PepperBrokerInfoBarDelegate::Show(
case CONTENT_SETTING_ALLOW: {
content::RecordAction(
content::UserMetricsAction("PPAPI.BrokerSettingAllow"));
+ tab_content_settings->SetPepperBrokerAllowed(true);
callback.Run(true);
break;
}
case CONTENT_SETTING_BLOCK: {
content::RecordAction(
content::UserMetricsAction("PPAPI.BrokerSettingDeny"));
+ tab_content_settings->SetPepperBrokerAllowed(false);
callback.Run(false);
break;
}
@@ -75,7 +80,7 @@ void PepperBrokerInfoBarDelegate::Show(
infobar_helper->AddInfoBar(
new PepperBrokerInfoBarDelegate(
infobar_helper, url, plugin_path, languages, content_settings,
- callback));
+ tab_content_settings, callback));
break;
}
default:
@@ -89,12 +94,14 @@ PepperBrokerInfoBarDelegate::PepperBrokerInfoBarDelegate(
const FilePath& plugin_path,
const std::string& languages,
HostContentSettingsMap* content_settings,
+ TabSpecificContentSettings* tab_content_settings,
const base::Callback<void(bool)>& callback)
: ConfirmInfoBarDelegate(helper),
url_(url),
plugin_path_(plugin_path),
languages_(languages),
content_settings_(content_settings),
+ tab_content_settings_(tab_content_settings),
callback_(callback) {
}
@@ -175,4 +182,5 @@ void PepperBrokerInfoBarDelegate::DispatchCallback(bool result) {
ContentSettingsPattern::Wildcard(),
CONTENT_SETTINGS_TYPE_PPAPI_BROKER,
std::string(), result ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK);
+ tab_content_settings_->SetPepperBrokerAllowed(result);
}

Powered by Google App Engine
This is Rietveld 408576698