From 404063d01c7a780fa0d35cda505ad4a5e561c1d0 Mon Sep 17 00:00:00 2001 From: "bauerb@chromium.org" Date: Sun, 10 Feb 2013 16:23:01 +0000 Subject: Add content settings page action for Pepper broker authorization. BUG=159199 Review URL: https://chromiumcodereview.appspot.com/11488009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181651 0039d316-1c4b-4281-b951-d872f2087c98 --- .../content_settings/tab_specific_content_settings.cc | 17 ++++++++++++++--- .../content_settings/tab_specific_content_settings.h | 7 +++++-- 2 files changed, 19 insertions(+), 5 deletions(-) (limited to 'chrome/browser/content_settings') diff --git a/chrome/browser/content_settings/tab_specific_content_settings.cc b/chrome/browser/content_settings/tab_specific_content_settings.cc index 39b6e86..fb98667 100644 --- a/chrome/browser/content_settings/tab_specific_content_settings.cc +++ b/chrome/browser/content_settings/tab_specific_content_settings.cc @@ -207,7 +207,8 @@ bool TabSpecificContentSettings::IsContentBlocked( content_type == CONTENT_SETTINGS_TYPE_COOKIES || content_type == CONTENT_SETTINGS_TYPE_POPUPS || content_type == CONTENT_SETTINGS_TYPE_MIXEDSCRIPT || - content_type == CONTENT_SETTINGS_TYPE_MEDIASTREAM) + content_type == CONTENT_SETTINGS_TYPE_MEDIASTREAM || + content_type == CONTENT_SETTINGS_TYPE_PPAPI_BROKER) return content_blocked_[content_type]; return false; @@ -226,10 +227,12 @@ void TabSpecificContentSettings::SetBlockageHasBeenIndicated( bool TabSpecificContentSettings::IsContentAccessed( ContentSettingsType content_type) const { // This method currently only returns meaningful values for the content type - // cookies and mediastream. + // cookies, mediastream, and PPAPI broker. if (content_type != CONTENT_SETTINGS_TYPE_COOKIES && - content_type != CONTENT_SETTINGS_TYPE_MEDIASTREAM) + content_type != CONTENT_SETTINGS_TYPE_MEDIASTREAM && + content_type != CONTENT_SETTINGS_TYPE_PPAPI_BROKER) { return false; + } return content_accessed_[content_type]; } @@ -475,6 +478,14 @@ void TabSpecificContentSettings::ClearGeolocationContentSettings() { geolocation_settings_state_.ClearStateMap(); } +void TabSpecificContentSettings::SetPepperBrokerAllowed(bool allowed) { + if (allowed) { + OnContentAccessed(CONTENT_SETTINGS_TYPE_PPAPI_BROKER); + } else { + OnContentBlocked(CONTENT_SETTINGS_TYPE_PPAPI_BROKER, std::string()); + } +} + void TabSpecificContentSettings::RenderViewForInterstitialPageCreated( RenderViewHost* render_view_host) { // We want to tell the renderer-side code to ignore content settings for this diff --git a/chrome/browser/content_settings/tab_specific_content_settings.h b/chrome/browser/content_settings/tab_specific_content_settings.h index fee681f..a13fe7e 100644 --- a/chrome/browser/content_settings/tab_specific_content_settings.h +++ b/chrome/browser/content_settings/tab_specific_content_settings.h @@ -229,6 +229,10 @@ class TabSpecificContentSettings load_plugins_link_enabled_ = enabled; } + // Called to indicate whether access to the Pepper broker was allowed or + // blocked. + void SetPepperBrokerAllowed(bool allowed); + // content::WebContentsObserver overrides. virtual void RenderViewForInterstitialPageCreated( content::RenderViewHost* render_view_host) OVERRIDE; @@ -250,6 +254,7 @@ class TabSpecificContentSettings // Message handlers. Public for testing. void OnContentBlocked(ContentSettingsType type, const std::string& resource_identifier); + void OnContentAccessed(ContentSettingsType type); // These methods are invoked on the UI thread by the static functions above. // Public for testing. @@ -294,8 +299,6 @@ class TabSpecificContentSettings void AddBlockedResource(ContentSettingsType content_type, const std::string& resource_identifier); - void OnContentAccessed(ContentSettingsType type); - // content::NotificationObserver implementation. virtual void Observe(int type, const content::NotificationSource& source, -- cgit v1.1