| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_CONTENT_SETTINGS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_CONTENT_SETTINGS_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CONTENT_SETTINGS_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CONTENT_SETTINGS_HANDLER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/prefs/public/pref_change_registrar.h" | 12 #include "base/prefs/public/pref_change_registrar.h" |
| 13 #include "base/prefs/public/pref_observer.h" |
| 13 #include "chrome/browser/pepper_flash_settings_manager.h" | 14 #include "chrome/browser/pepper_flash_settings_manager.h" |
| 14 #include "chrome/browser/ui/webui/options/options_ui.h" | 15 #include "chrome/browser/ui/webui/options/options_ui.h" |
| 15 #include "chrome/common/content_settings.h" | 16 #include "chrome/common/content_settings.h" |
| 16 #include "chrome/common/content_settings_types.h" | 17 #include "chrome/common/content_settings_types.h" |
| 17 #include "content/public/browser/notification_observer.h" | 18 #include "content/public/browser/notification_observer.h" |
| 18 #include "content/public/browser/notification_registrar.h" | 19 #include "content/public/browser/notification_registrar.h" |
| 19 | 20 |
| 20 class HostContentSettingsMap; | 21 class HostContentSettingsMap; |
| 21 class ProtocolHandlerRegistry; | 22 class ProtocolHandlerRegistry; |
| 22 | 23 |
| 23 namespace options { | 24 namespace options { |
| 24 | 25 |
| 25 class ContentSettingsHandler : public OptionsPageUIHandler, | 26 class ContentSettingsHandler : public OptionsPageUIHandler, |
| 26 public PepperFlashSettingsManager::Client { | 27 public PepperFlashSettingsManager::Client, |
| 28 public PrefObserver { |
| 27 public: | 29 public: |
| 28 ContentSettingsHandler(); | 30 ContentSettingsHandler(); |
| 29 virtual ~ContentSettingsHandler(); | 31 virtual ~ContentSettingsHandler(); |
| 30 | 32 |
| 31 // OptionsPageUIHandler implementation. | 33 // OptionsPageUIHandler implementation. |
| 32 virtual void GetLocalizedValues( | 34 virtual void GetLocalizedValues( |
| 33 base::DictionaryValue* localized_strings) OVERRIDE; | 35 base::DictionaryValue* localized_strings) OVERRIDE; |
| 34 virtual void InitializeHandler() OVERRIDE; | 36 virtual void InitializeHandler() OVERRIDE; |
| 35 virtual void InitializePage() OVERRIDE; | 37 virtual void InitializePage() OVERRIDE; |
| 36 virtual void RegisterMessages() OVERRIDE; | 38 virtual void RegisterMessages() OVERRIDE; |
| 37 | 39 |
| 38 // content::NotificationObserver implementation. | 40 // content::NotificationObserver implementation. |
| 39 virtual void Observe(int type, | 41 virtual void Observe(int type, |
| 40 const content::NotificationSource& source, | 42 const content::NotificationSource& source, |
| 41 const content::NotificationDetails& details) OVERRIDE; | 43 const content::NotificationDetails& details) OVERRIDE; |
| 42 | 44 |
| 45 // PrefObserver implementation. |
| 46 virtual void OnPreferenceChanged(PrefServiceBase* service, |
| 47 const std::string& pref_name) OVERRIDE; |
| 48 |
| 43 // PepperFlashSettingsManager::Client implementation. | 49 // PepperFlashSettingsManager::Client implementation. |
| 44 virtual void OnGetPermissionSettingsCompleted( | 50 virtual void OnGetPermissionSettingsCompleted( |
| 45 uint32 request_id, | 51 uint32 request_id, |
| 46 bool success, | 52 bool success, |
| 47 PP_Flash_BrowserOperations_Permission default_permission, | 53 PP_Flash_BrowserOperations_Permission default_permission, |
| 48 const ppapi::FlashSiteSettings& sites) OVERRIDE; | 54 const ppapi::FlashSiteSettings& sites) OVERRIDE; |
| 49 | 55 |
| 50 // Gets a string identifier for the group name, for use in HTML. | 56 // Gets a string identifier for the group name, for use in HTML. |
| 51 static std::string ContentSettingsTypeToGroupName(ContentSettingsType type); | 57 static std::string ContentSettingsTypeToGroupName(ContentSettingsType type); |
| 52 | 58 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 | 189 |
| 184 static const ExContentSettingsTypeNameEntry | 190 static const ExContentSettingsTypeNameEntry |
| 185 kExContentSettingsTypeGroupNames[]; | 191 kExContentSettingsTypeGroupNames[]; |
| 186 | 192 |
| 187 DISALLOW_COPY_AND_ASSIGN(ContentSettingsHandler); | 193 DISALLOW_COPY_AND_ASSIGN(ContentSettingsHandler); |
| 188 }; | 194 }; |
| 189 | 195 |
| 190 } // namespace options | 196 } // namespace options |
| 191 | 197 |
| 192 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CONTENT_SETTINGS_HANDLER_H_ | 198 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CONTENT_SETTINGS_HANDLER_H_ |
| OLD | NEW |