OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/common/notification_observer.h" | 13 #include "content/common/notification_observer.h" |
14 #include "content/common/notification_registrar.h" | 14 #include "content/common/notification_registrar.h" |
15 | 15 |
16 class HostContentSettingsMap; | 16 class HostContentSettingsMap; |
| 17 class ProtocolHandlerRegistry; |
17 | 18 |
18 class ContentSettingsHandler : public OptionsPageUIHandler { | 19 class ContentSettingsHandler : public OptionsPageUIHandler { |
19 public: | 20 public: |
20 ContentSettingsHandler(); | 21 ContentSettingsHandler(); |
21 virtual ~ContentSettingsHandler(); | 22 virtual ~ContentSettingsHandler(); |
22 | 23 |
23 // OptionsPageUIHandler implementation. | 24 // OptionsPageUIHandler implementation. |
24 virtual void GetLocalizedValues(DictionaryValue* localized_strings); | 25 virtual void GetLocalizedValues(DictionaryValue* localized_strings); |
25 | 26 |
26 virtual void Initialize(); | 27 virtual void Initialize(); |
(...skipping 27 matching lines...) Expand all Loading... |
54 // Clobbers and rebuilds just the geolocation exception table. | 55 // Clobbers and rebuilds just the geolocation exception table. |
55 void UpdateGeolocationExceptionsView(); | 56 void UpdateGeolocationExceptionsView(); |
56 // Clobbers and rebuilds just the desktop notification exception table. | 57 // Clobbers and rebuilds just the desktop notification exception table. |
57 void UpdateNotificationExceptionsView(); | 58 void UpdateNotificationExceptionsView(); |
58 // Clobbers and rebuilds an exception table that's managed by the host content | 59 // Clobbers and rebuilds an exception table that's managed by the host content |
59 // settings map. | 60 // settings map. |
60 void UpdateExceptionsViewFromHostContentSettingsMap(ContentSettingsType type); | 61 void UpdateExceptionsViewFromHostContentSettingsMap(ContentSettingsType type); |
61 // As above, but acts on the OTR table for the content setting type. | 62 // As above, but acts on the OTR table for the content setting type. |
62 void UpdateExceptionsViewFromOTRHostContentSettingsMap( | 63 void UpdateExceptionsViewFromOTRHostContentSettingsMap( |
63 ContentSettingsType type); | 64 ContentSettingsType type); |
| 65 // Updates the radio buttons for enabling / disabling handlers. |
| 66 void UpdateHandlersEnabledRadios(); |
64 | 67 |
65 // Callbacks used by the page ------------------------------------------------ | 68 // Callbacks used by the page ------------------------------------------------ |
66 | 69 |
67 // Sets the default value for a specific content type. |args| includes the | 70 // Sets the default value for a specific content type. |args| includes the |
68 // content type and a string describing the new default the user has | 71 // content type and a string describing the new default the user has |
69 // chosen. | 72 // chosen. |
70 void SetContentFilter(const ListValue* args); | 73 void SetContentFilter(const ListValue* args); |
71 | 74 |
72 // Removes the given row from the table. The first entry in |args| is the | 75 // Removes the given row from the table. The first entry in |args| is the |
73 // content type, and the rest of the arguments depend on the content type | 76 // content type, and the rest of the arguments depend on the content type |
(...skipping 20 matching lines...) Expand all Loading... |
94 // is no active incognito session. | 97 // is no active incognito session. |
95 HostContentSettingsMap* GetOTRContentSettingsMap(); | 98 HostContentSettingsMap* GetOTRContentSettingsMap(); |
96 | 99 |
97 // Gets the default setting in string form. | 100 // Gets the default setting in string form. |
98 std::string GetSettingDefaultFromModel(ContentSettingsType type); | 101 std::string GetSettingDefaultFromModel(ContentSettingsType type); |
99 | 102 |
100 // Returns true if the default setting for the given content settings type | 103 // Returns true if the default setting for the given content settings type |
101 // |type| is managed. | 104 // |type| is managed. |
102 bool GetDefaultSettingManagedFromModel(ContentSettingsType type); | 105 bool GetDefaultSettingManagedFromModel(ContentSettingsType type); |
103 | 106 |
| 107 // Gets the ProtocolHandlerRegistry for the normal profile. |
| 108 ProtocolHandlerRegistry* GetProtocolHandlerRegistry(); |
| 109 |
104 // Member variables --------------------------------------------------------- | 110 // Member variables --------------------------------------------------------- |
105 | 111 |
106 NotificationRegistrar notification_registrar_; | 112 NotificationRegistrar notification_registrar_; |
107 PrefChangeRegistrar pref_change_registrar_; | 113 PrefChangeRegistrar pref_change_registrar_; |
108 | 114 |
109 DISALLOW_COPY_AND_ASSIGN(ContentSettingsHandler); | 115 DISALLOW_COPY_AND_ASSIGN(ContentSettingsHandler); |
110 }; | 116 }; |
111 | 117 |
112 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CONTENT_SETTINGS_HANDLER_H_ | 118 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CONTENT_SETTINGS_HANDLER_H_ |
OLD | NEW |