| OLD | NEW |
| 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/plugin_data_remover_helper.h" | 9 #include "chrome/browser/plugin_data_remover_helper.h" |
| 10 #include "chrome/browser/prefs/pref_change_registrar.h" | 10 #include "chrome/browser/prefs/pref_change_registrar.h" |
| 11 #include "chrome/browser/ui/webui/options/options_ui.h" | 11 #include "chrome/browser/ui/webui/options/options_ui.h" |
| 12 #include "chrome/common/content_settings_types.h" | 12 #include "chrome/common/content_settings_types.h" |
| 13 #include "chrome/common/content_settings.h" |
| 13 #include "content/public/browser/notification_observer.h" | 14 #include "content/public/browser/notification_observer.h" |
| 14 #include "content/public/browser/notification_registrar.h" | 15 #include "content/public/browser/notification_registrar.h" |
| 15 | 16 |
| 16 class HostContentSettingsMap; | 17 class HostContentSettingsMap; |
| 17 class ProtocolHandlerRegistry; | 18 class ProtocolHandlerRegistry; |
| 18 | 19 |
| 19 class ContentSettingsHandler : public OptionsPageUIHandler { | 20 class ContentSettingsHandler : public OptionsPageUIHandler { |
| 20 public: | 21 public: |
| 21 ContentSettingsHandler(); | 22 ContentSettingsHandler(); |
| 22 virtual ~ContentSettingsHandler(); | 23 virtual ~ContentSettingsHandler(); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // Changes the value of an exception. Called after the user is done editing an | 81 // Changes the value of an exception. Called after the user is done editing an |
| 81 // exception. | 82 // exception. |
| 82 void SetException(const ListValue* args); | 83 void SetException(const ListValue* args); |
| 83 | 84 |
| 84 // Called to decide whether a given pattern is valid, or if it should be | 85 // Called to decide whether a given pattern is valid, or if it should be |
| 85 // rejected. Called while the user is editing an exception pattern. | 86 // rejected. Called while the user is editing an exception pattern. |
| 86 void CheckExceptionPatternValidity(const ListValue* args); | 87 void CheckExceptionPatternValidity(const ListValue* args); |
| 87 | 88 |
| 88 // Utility functions --------------------------------------------------------- | 89 // Utility functions --------------------------------------------------------- |
| 89 | 90 |
| 91 // Applies content settings whitelists to reduce breakage / user confusion. |
| 92 void ApplyWhitelist(ContentSettingsType content_type, |
| 93 ContentSetting default_setting); |
| 94 |
| 90 // Gets the HostContentSettingsMap for the normal profile. | 95 // Gets the HostContentSettingsMap for the normal profile. |
| 91 HostContentSettingsMap* GetContentSettingsMap(); | 96 HostContentSettingsMap* GetContentSettingsMap(); |
| 92 | 97 |
| 93 // Gets the HostContentSettingsMap for the incognito profile, or NULL if there | 98 // Gets the HostContentSettingsMap for the incognito profile, or NULL if there |
| 94 // is no active incognito session. | 99 // is no active incognito session. |
| 95 HostContentSettingsMap* GetOTRContentSettingsMap(); | 100 HostContentSettingsMap* GetOTRContentSettingsMap(); |
| 96 | 101 |
| 97 // Gets the default setting in string form. If |provider_id| is not NULL, the | 102 // Gets the default setting in string form. If |provider_id| is not NULL, the |
| 98 // id of the provider which provided the default setting is assigned to it. | 103 // id of the provider which provided the default setting is assigned to it. |
| 99 std::string GetSettingDefaultFromModel(ContentSettingsType type, | 104 std::string GetSettingDefaultFromModel(ContentSettingsType type, |
| 100 std::string* provider_id); | 105 std::string* provider_id); |
| 101 | 106 |
| 102 // Gets the ProtocolHandlerRegistry for the normal profile. | 107 // Gets the ProtocolHandlerRegistry for the normal profile. |
| 103 ProtocolHandlerRegistry* GetProtocolHandlerRegistry(); | 108 ProtocolHandlerRegistry* GetProtocolHandlerRegistry(); |
| 104 | 109 |
| 105 // Member variables --------------------------------------------------------- | 110 // Member variables --------------------------------------------------------- |
| 106 | 111 |
| 107 content::NotificationRegistrar notification_registrar_; | 112 content::NotificationRegistrar notification_registrar_; |
| 108 PrefChangeRegistrar pref_change_registrar_; | 113 PrefChangeRegistrar pref_change_registrar_; |
| 109 | 114 |
| 110 DISALLOW_COPY_AND_ASSIGN(ContentSettingsHandler); | 115 DISALLOW_COPY_AND_ASSIGN(ContentSettingsHandler); |
| 111 }; | 116 }; |
| 112 | 117 |
| 113 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CONTENT_SETTINGS_HANDLER_H_ | 118 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CONTENT_SETTINGS_HANDLER_H_ |
| OLD | NEW |