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

Unified Diff: chrome/browser/ui/webui/options2/content_settings_handler2.h

Issue 10479015: Pepper Flash settings integration - camera and microphone. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase & resolve conflicts Created 8 years, 6 months 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/ui/webui/options2/content_settings_handler2.h
diff --git a/chrome/browser/ui/webui/options2/content_settings_handler2.h b/chrome/browser/ui/webui/options2/content_settings_handler2.h
index 2ec69095468c25ad1a93657ae1ec5d22021db6af..7e2cc42b4d2c5ce08b87114e2161a76c91ce2d50 100644
--- a/chrome/browser/ui/webui/options2/content_settings_handler2.h
+++ b/chrome/browser/ui/webui/options2/content_settings_handler2.h
@@ -6,7 +6,11 @@
#define CHROME_BROWSER_UI_WEBUI_OPTIONS2_CONTENT_SETTINGS_HANDLER2_H_
#pragma once
-#include "chrome/browser/plugin_data_remover_helper.h"
+#include <map>
+#include <string>
+
+#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/pepper_flash_settings_manager.h"
#include "chrome/browser/prefs/pref_change_registrar.h"
#include "chrome/browser/ui/webui/options2/options_ui2.h"
#include "chrome/common/content_settings_types.h"
@@ -19,7 +23,8 @@ class ProtocolHandlerRegistry;
namespace options2 {
-class ContentSettingsHandler : public OptionsPageUIHandler {
+class ContentSettingsHandler : public OptionsPageUIHandler,
+ public PepperFlashSettingsManager::Client {
public:
ContentSettingsHandler();
virtual ~ContentSettingsHandler();
@@ -35,20 +40,48 @@ class ContentSettingsHandler : public OptionsPageUIHandler {
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
+ // PepperFlashSettingsManager::Client implementation.
+ virtual void OnGetPermissionSettingsCompleted(
+ uint32 request_id,
+ bool success,
+ PP_Flash_BrowserOperations_Permission default_permission,
+ const ppapi::FlashSiteSettings& sites) OVERRIDE;
+
// Gets a string identifier for the group name, for use in HTML.
static std::string ContentSettingsTypeToGroupName(ContentSettingsType type);
private:
+ // Extends ContentSettingsType with some other types that will be also
+ // displayed in the content settings UI.
+ class ExContentSettingsType;
+ struct ExContentSettingsTypeNameEntry;
+
+ struct CachedPepperFlashSettings {
+ CachedPepperFlashSettings()
+ : default_permission(PP_FLASH_BROWSEROPERATIONS_PERMISSION_DEFAULT),
+ initialized(false) {
+ }
+
+ PP_Flash_BrowserOperations_Permission default_permission;
+
+ typedef std::map<std::string, PP_Flash_BrowserOperations_Permission>
+ SiteMap;
+ SiteMap sites;
+
+ bool initialized;
+ };
+
// Functions that call into the page -----------------------------------------
// Updates the page with the default settings (allow, ask, block, etc.)
- void UpdateSettingDefaultFromModel(ContentSettingsType type);
+ void UpdateSettingDefaultFromModel(const ExContentSettingsType& type);
// Clobbers and rebuilds the specific content setting type exceptions table.
- void UpdateExceptionsViewFromModel(ContentSettingsType type);
+ void UpdateExceptionsViewFromModel(const ExContentSettingsType& type);
// Clobbers and rebuilds the specific content setting type exceptions
// OTR table.
- void UpdateOTRExceptionsViewFromModel(ContentSettingsType type);
+ void UpdateOTRExceptionsViewFromModel(
+ const ExContentSettingsType& type);
// Clobbers and rebuilds all the exceptions tables in the page (both normal
// and OTR tables).
void UpdateAllExceptionsViewsFromModel();
@@ -58,6 +91,9 @@ class ContentSettingsHandler : public OptionsPageUIHandler {
void UpdateGeolocationExceptionsView();
// Clobbers and rebuilds just the desktop notification exception table.
void UpdateNotificationExceptionsView();
+ // Clobbers and rebuilds just the Pepper Flash camera and microphone exception
+ // table.
+ void UpdateFlashCameraMicExceptionsView();
// Clobbers and rebuilds an exception table that's managed by the host content
// settings map.
void UpdateExceptionsViewFromHostContentSettingsMap(ContentSettingsType type);
@@ -102,16 +138,26 @@ class ContentSettingsHandler : public OptionsPageUIHandler {
// Gets the default setting in string form. If |provider_id| is not NULL, the
// id of the provider which provided the default setting is assigned to it.
- std::string GetSettingDefaultFromModel(ContentSettingsType type,
+ std::string GetSettingDefaultFromModel(const ExContentSettingsType& type,
std::string* provider_id);
// Gets the ProtocolHandlerRegistry for the normal profile.
ProtocolHandlerRegistry* GetProtocolHandlerRegistry();
+ static ExContentSettingsType ExContentSettingsTypeFromGroupName(
+ const std::string& name);
+ static std::string ExContentSettingsTypeToGroupName(
+ const ExContentSettingsType& type);
+
// Member variables ---------------------------------------------------------
content::NotificationRegistrar notification_registrar_;
PrefChangeRegistrar pref_change_registrar_;
+ scoped_ptr<PepperFlashSettingsManager> flash_settings_manager_;
+ CachedPepperFlashSettings flash_cameramic_settings_;
+
+ static const ExContentSettingsTypeNameEntry
+ kExContentSettingsTypeGroupNames[];
DISALLOW_COPY_AND_ASSIGN(ContentSettingsHandler);
};

Powered by Google App Engine
This is Rietveld 408576698