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 CookieSettings; |
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(); |
23 | 24 |
24 // OptionsPageUIHandler implementation. | 25 // OptionsPageUIHandler implementation. |
25 virtual void GetLocalizedValues(DictionaryValue* localized_strings); | 26 virtual void GetLocalizedValues(DictionaryValue* localized_strings); |
(...skipping 23 matching lines...) Expand all Loading... |
49 void UpdateOTRExceptionsViewFromModel(ContentSettingsType type); | 50 void UpdateOTRExceptionsViewFromModel(ContentSettingsType type); |
50 // Clobbers and rebuilds all the exceptions tables in the page (both normal | 51 // Clobbers and rebuilds all the exceptions tables in the page (both normal |
51 // and OTR tables). | 52 // and OTR tables). |
52 void UpdateAllExceptionsViewsFromModel(); | 53 void UpdateAllExceptionsViewsFromModel(); |
53 // As above, but only OTR tables. | 54 // As above, but only OTR tables. |
54 void UpdateAllOTRExceptionsViewsFromModel(); | 55 void UpdateAllOTRExceptionsViewsFromModel(); |
55 // Clobbers and rebuilds just the geolocation exception table. | 56 // Clobbers and rebuilds just the geolocation exception table. |
56 void UpdateGeolocationExceptionsView(); | 57 void UpdateGeolocationExceptionsView(); |
57 // Clobbers and rebuilds just the desktop notification exception table. | 58 // Clobbers and rebuilds just the desktop notification exception table. |
58 void UpdateNotificationExceptionsView(); | 59 void UpdateNotificationExceptionsView(); |
| 60 // Clobbers and rebuilds just the cookie exception table. |
| 61 void UpdateCookieExceptionsView(); |
| 62 // Helper for building the cookie exception table. |
| 63 void UpdateCookieExceptionsViewFromCookieSettings( |
| 64 CookieSettings* cookie_settings, const std::string& function_name); |
59 // Clobbers and rebuilds an exception table that's managed by the host content | 65 // Clobbers and rebuilds an exception table that's managed by the host content |
60 // settings map. | 66 // settings map. |
61 void UpdateExceptionsViewFromHostContentSettingsMap(ContentSettingsType type); | 67 void UpdateExceptionsViewFromHostContentSettingsMap(ContentSettingsType type); |
62 // As above, but acts on the OTR table for the content setting type. | 68 // As above, but acts on the OTR table for the content setting type. |
63 void UpdateExceptionsViewFromOTRHostContentSettingsMap( | 69 void UpdateExceptionsViewFromOTRHostContentSettingsMap( |
64 ContentSettingsType type); | 70 ContentSettingsType type); |
65 // Updates the radio buttons for enabling / disabling handlers. | 71 // Updates the radio buttons for enabling / disabling handlers. |
66 void UpdateHandlersEnabledRadios(); | 72 void UpdateHandlersEnabledRadios(); |
67 | 73 |
68 // Callbacks used by the page ------------------------------------------------ | 74 // Callbacks used by the page ------------------------------------------------ |
(...skipping 18 matching lines...) Expand all Loading... |
87 | 93 |
88 // Utility functions --------------------------------------------------------- | 94 // Utility functions --------------------------------------------------------- |
89 | 95 |
90 // Gets the HostContentSettingsMap for the normal profile. | 96 // Gets the HostContentSettingsMap for the normal profile. |
91 HostContentSettingsMap* GetContentSettingsMap(); | 97 HostContentSettingsMap* GetContentSettingsMap(); |
92 | 98 |
93 // Gets the HostContentSettingsMap for the incognito profile, or NULL if there | 99 // Gets the HostContentSettingsMap for the incognito profile, or NULL if there |
94 // is no active incognito session. | 100 // is no active incognito session. |
95 HostContentSettingsMap* GetOTRContentSettingsMap(); | 101 HostContentSettingsMap* GetOTRContentSettingsMap(); |
96 | 102 |
| 103 // Gets the CookieSettings for the normal profile. |
| 104 CookieSettings* GetCookieSettings(); |
| 105 |
| 106 // Gets the CookieSettings for the incognito profile, or NULL if there is no |
| 107 // active incognito session. |
| 108 CookieSettings* GetOTRCookieSettings(); |
| 109 |
97 // Gets the default setting in string form. | 110 // Gets the default setting in string form. |
98 std::string GetSettingDefaultFromModel(ContentSettingsType type); | 111 std::string GetSettingDefaultFromModel(ContentSettingsType type); |
99 | 112 |
100 // Returns true if the default setting for the given content settings type | 113 // Returns true if the default setting for the given content settings type |
101 // |type| is managed. | 114 // |type| is managed. |
102 bool GetDefaultSettingManagedFromModel(ContentSettingsType type); | 115 bool GetDefaultSettingManagedFromModel(ContentSettingsType type); |
103 | 116 |
104 // Gets the ProtocolHandlerRegistry for the normal profile. | 117 // Gets the ProtocolHandlerRegistry for the normal profile. |
105 ProtocolHandlerRegistry* GetProtocolHandlerRegistry(); | 118 ProtocolHandlerRegistry* GetProtocolHandlerRegistry(); |
106 | 119 |
107 // Member variables --------------------------------------------------------- | 120 // Member variables --------------------------------------------------------- |
108 | 121 |
109 NotificationRegistrar notification_registrar_; | 122 NotificationRegistrar notification_registrar_; |
110 PrefChangeRegistrar pref_change_registrar_; | 123 PrefChangeRegistrar pref_change_registrar_; |
111 | 124 |
112 DISALLOW_COPY_AND_ASSIGN(ContentSettingsHandler); | 125 DISALLOW_COPY_AND_ASSIGN(ContentSettingsHandler); |
113 }; | 126 }; |
114 | 127 |
115 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CONTENT_SETTINGS_HANDLER_H_ | 128 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CONTENT_SETTINGS_HANDLER_H_ |
OLD | NEW |