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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/prefs/pref_change_registrar.h" | 11 #include "base/prefs/pref_change_registrar.h" |
12 #include "chrome/browser/pepper_flash_settings_manager.h" | 12 #include "chrome/browser/pepper_flash_settings_manager.h" |
13 #include "chrome/browser/ui/webui/options/options_ui.h" | 13 #include "chrome/browser/ui/webui/options/options_ui.h" |
14 #include "chrome/browser/ui/webui/options/pepper_flash_content_settings_utils.h" | 14 #include "chrome/browser/ui/webui/options/pepper_flash_content_settings_utils.h" |
15 #include "chrome/common/content_settings.h" | 15 #include "chrome/common/content_settings.h" |
16 #include "chrome/common/content_settings_types.h" | 16 #include "chrome/common/content_settings_types.h" |
| 17 #include "content/public/browser/host_zoom_map.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 content::NotificationObserver, | 27 public content::NotificationObserver, |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // As above, but only OTR tables. | 103 // As above, but only OTR tables. |
103 void UpdateAllOTRExceptionsViewsFromModel(); | 104 void UpdateAllOTRExceptionsViewsFromModel(); |
104 // Clobbers and rebuilds just the geolocation exception table. | 105 // Clobbers and rebuilds just the geolocation exception table. |
105 void UpdateGeolocationExceptionsView(); | 106 void UpdateGeolocationExceptionsView(); |
106 // Clobbers and rebuilds just the desktop notification exception table. | 107 // Clobbers and rebuilds just the desktop notification exception table. |
107 void UpdateNotificationExceptionsView(); | 108 void UpdateNotificationExceptionsView(); |
108 // Clobbers and rebuilds just the Media device exception table. | 109 // Clobbers and rebuilds just the Media device exception table. |
109 void UpdateMediaExceptionsView(); | 110 void UpdateMediaExceptionsView(); |
110 // Clobbers and rebuilds just the MIDI SysEx exception table. | 111 // Clobbers and rebuilds just the MIDI SysEx exception table. |
111 void UpdateMIDISysExExceptionsView(); | 112 void UpdateMIDISysExExceptionsView(); |
| 113 // Clobbers and rebuilds just the zoom levels exception table. |
| 114 void UpdateZoomLevelsExceptionsView(); |
112 // Clobbers and rebuilds an exception table that's managed by the host content | 115 // Clobbers and rebuilds an exception table that's managed by the host content |
113 // settings map. | 116 // settings map. |
114 void UpdateExceptionsViewFromHostContentSettingsMap(ContentSettingsType type); | 117 void UpdateExceptionsViewFromHostContentSettingsMap(ContentSettingsType type); |
115 // As above, but acts on the OTR table for the content setting type. | 118 // As above, but acts on the OTR table for the content setting type. |
116 void UpdateExceptionsViewFromOTRHostContentSettingsMap( | 119 void UpdateExceptionsViewFromOTRHostContentSettingsMap( |
117 ContentSettingsType type); | 120 ContentSettingsType type); |
118 // Updates the radio buttons for enabling / disabling handlers. | 121 // Updates the radio buttons for enabling / disabling handlers. |
119 void UpdateHandlersEnabledRadios(); | 122 void UpdateHandlersEnabledRadios(); |
120 // Removes one geolocation exception. | 123 // Removes one geolocation exception. |args| contains the parameters passed to |
| 124 // RemoveException(). |arg_index| points to the first parameter n |args| that |
| 125 // appears after the specified exception type to be removed by |
| 126 // RemoveException(). |
121 void RemoveGeolocationException(const base::ListValue* args, | 127 void RemoveGeolocationException(const base::ListValue* args, |
122 size_t arg_index); | 128 size_t arg_index); |
123 // Removes one notification exception. | 129 // Removes one notification exception. |
124 void RemoveNotificationException(const base::ListValue* args, | 130 void RemoveNotificationException(const base::ListValue* args, |
125 size_t arg_index); | 131 size_t arg_index); |
126 // Removes one media camera and microphone exception. | 132 // Removes one media camera and microphone exception. |
127 void RemoveMediaException(const base::ListValue* args, size_t arg_index); | 133 void RemoveMediaException(const base::ListValue* args, size_t arg_index); |
128 // Removes one exception of |type| from the host content settings map. | 134 // Removes one exception of |type| from the host content settings map. |
129 void RemoveExceptionFromHostContentSettingsMap( | 135 void RemoveExceptionFromHostContentSettingsMap( |
130 const base::ListValue* args, | 136 const base::ListValue* args, |
131 size_t arg_index, | 137 size_t arg_index, |
132 ContentSettingsType type); | 138 ContentSettingsType type); |
| 139 // Removes one zoom level exception. |
| 140 void RemoveZoomLevelException(const base::ListValue* args, size_t arg_index); |
133 | 141 |
134 // Callbacks used by the page ------------------------------------------------ | 142 // Callbacks used by the page ------------------------------------------------ |
135 | 143 |
136 // Sets the default value for a specific content type. |args| includes the | 144 // Sets the default value for a specific content type. |args| includes the |
137 // content type and a string describing the new default the user has | 145 // content type and a string describing the new default the user has |
138 // chosen. | 146 // chosen. |
139 void SetContentFilter(const base::ListValue* args); | 147 void SetContentFilter(const base::ListValue* args); |
140 | 148 |
141 // Removes the given row from the table. The first entry in |args| is the | 149 // Removes the given row from the table. The first entry in |args| is the |
142 // content type, and the rest of the arguments depend on the content type | 150 // content type, and the rest of the arguments depend on the content type |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 void RefreshFlashMediaSettings(); | 183 void RefreshFlashMediaSettings(); |
176 | 184 |
177 // Fills in |exceptions| with Values for the given |type| from |map|. | 185 // Fills in |exceptions| with Values for the given |type| from |map|. |
178 void GetExceptionsFromHostContentSettingsMap( | 186 void GetExceptionsFromHostContentSettingsMap( |
179 const HostContentSettingsMap* map, | 187 const HostContentSettingsMap* map, |
180 ContentSettingsType type, | 188 ContentSettingsType type, |
181 base::ListValue* exceptions); | 189 base::ListValue* exceptions); |
182 | 190 |
183 void OnPepperFlashPrefChanged(); | 191 void OnPepperFlashPrefChanged(); |
184 | 192 |
| 193 // content::HostZoomMap subscription. |
| 194 void OnZoomLevelChanged(const content::HostZoomMap::ZoomLevelChange& change); |
| 195 |
185 void ShowFlashMediaLink(LinkType link_type, bool show); | 196 void ShowFlashMediaLink(LinkType link_type, bool show); |
186 | 197 |
187 void UpdateFlashMediaLinksVisibility(); | 198 void UpdateFlashMediaLinksVisibility(); |
188 | 199 |
189 void UpdateProtectedContentExceptionsButton(); | 200 void UpdateProtectedContentExceptionsButton(); |
190 | 201 |
191 // Member variables --------------------------------------------------------- | 202 // Member variables --------------------------------------------------------- |
192 | 203 |
193 content::NotificationRegistrar notification_registrar_; | 204 content::NotificationRegistrar notification_registrar_; |
194 PrefChangeRegistrar pref_change_registrar_; | 205 PrefChangeRegistrar pref_change_registrar_; |
195 scoped_ptr<PepperFlashSettingsManager> flash_settings_manager_; | 206 scoped_ptr<PepperFlashSettingsManager> flash_settings_manager_; |
196 MediaSettingsInfo media_settings_; | 207 MediaSettingsInfo media_settings_; |
| 208 scoped_ptr<content::HostZoomMap::Subscription> host_zoom_map_subscription_; |
197 | 209 |
198 DISALLOW_COPY_AND_ASSIGN(ContentSettingsHandler); | 210 DISALLOW_COPY_AND_ASSIGN(ContentSettingsHandler); |
199 }; | 211 }; |
200 | 212 |
201 } // namespace options | 213 } // namespace options |
202 | 214 |
203 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CONTENT_SETTINGS_HANDLER_H_ | 215 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CONTENT_SETTINGS_HANDLER_H_ |
OLD | NEW |