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_OPTIONS2_CONTENT_SETTINGS_HANDLER2_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS2_CONTENT_SETTINGS_HANDLER2_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_CONTENT_SETTINGS_HANDLER2_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_CONTENT_SETTINGS_HANDLER2_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/options2/options_ui2.h" | 11 #include "chrome/browser/ui/webui/options2/options_ui2.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 namespace options2 { | 20 namespace options2 { |
20 | 21 |
21 class ContentSettingsHandler : public OptionsPageUIHandler { | 22 class ContentSettingsHandler : public OptionsPageUIHandler { |
22 public: | 23 public: |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // Changes the value of an exception. Called after the user is done editing an | 83 // Changes the value of an exception. Called after the user is done editing an |
83 // exception. | 84 // exception. |
84 void SetException(const ListValue* args); | 85 void SetException(const ListValue* args); |
85 | 86 |
86 // Called to decide whether a given pattern is valid, or if it should be | 87 // Called to decide whether a given pattern is valid, or if it should be |
87 // rejected. Called while the user is editing an exception pattern. | 88 // rejected. Called while the user is editing an exception pattern. |
88 void CheckExceptionPatternValidity(const ListValue* args); | 89 void CheckExceptionPatternValidity(const ListValue* args); |
89 | 90 |
90 // Utility functions --------------------------------------------------------- | 91 // Utility functions --------------------------------------------------------- |
91 | 92 |
| 93 // Applies content settings whitelists to reduce breakage / user confusion. |
| 94 void ApplyWhitelist(ContentSettingsType content_type, |
| 95 ContentSetting default_setting); |
| 96 |
92 // Gets the HostContentSettingsMap for the normal profile. | 97 // Gets the HostContentSettingsMap for the normal profile. |
93 HostContentSettingsMap* GetContentSettingsMap(); | 98 HostContentSettingsMap* GetContentSettingsMap(); |
94 | 99 |
95 // Gets the HostContentSettingsMap for the incognito profile, or NULL if there | 100 // Gets the HostContentSettingsMap for the incognito profile, or NULL if there |
96 // is no active incognito session. | 101 // is no active incognito session. |
97 HostContentSettingsMap* GetOTRContentSettingsMap(); | 102 HostContentSettingsMap* GetOTRContentSettingsMap(); |
98 | 103 |
99 // Gets the default setting in string form. If |provider_id| is not NULL, the | 104 // Gets the default setting in string form. If |provider_id| is not NULL, the |
100 // id of the provider which provided the default setting is assigned to it. | 105 // id of the provider which provided the default setting is assigned to it. |
101 std::string GetSettingDefaultFromModel(ContentSettingsType type, | 106 std::string GetSettingDefaultFromModel(ContentSettingsType type, |
102 std::string* provider_id); | 107 std::string* provider_id); |
103 | 108 |
104 // Gets the ProtocolHandlerRegistry for the normal profile. | 109 // Gets the ProtocolHandlerRegistry for the normal profile. |
105 ProtocolHandlerRegistry* GetProtocolHandlerRegistry(); | 110 ProtocolHandlerRegistry* GetProtocolHandlerRegistry(); |
106 | 111 |
107 // Member variables --------------------------------------------------------- | 112 // Member variables --------------------------------------------------------- |
108 | 113 |
109 content::NotificationRegistrar notification_registrar_; | 114 content::NotificationRegistrar notification_registrar_; |
110 PrefChangeRegistrar pref_change_registrar_; | 115 PrefChangeRegistrar pref_change_registrar_; |
111 | 116 |
112 DISALLOW_COPY_AND_ASSIGN(ContentSettingsHandler); | 117 DISALLOW_COPY_AND_ASSIGN(ContentSettingsHandler); |
113 }; | 118 }; |
114 | 119 |
115 } // namespace options2 | 120 } // namespace options2 |
116 | 121 |
117 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_CONTENT_SETTINGS_HANDLER2_H_ | 122 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_CONTENT_SETTINGS_HANDLER2_H_ |
OLD | NEW |