| 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. |
| 121 void RemoveGeolocationException(const base::ListValue* args, | 124 void RemoveGeolocationException(const base::ListValue* args, |
| 122 size_t arg_index); | 125 size_t arg_index); |
| 123 // Removes one notification exception. | 126 // Removes one notification exception. |
| 124 void RemoveNotificationException(const base::ListValue* args, | 127 void RemoveNotificationException(const base::ListValue* args, |
| 125 size_t arg_index); | 128 size_t arg_index); |
| 126 // Removes one media camera and microphone exception. | 129 // Removes one media camera and microphone exception. |
| 127 void RemoveMediaException(const base::ListValue* args, size_t arg_index); | 130 void RemoveMediaException(const base::ListValue* args, size_t arg_index); |
| 128 // Removes one exception of |type| from the host content settings map. | 131 // Removes one exception of |type| from the host content settings map. |
| 129 void RemoveExceptionFromHostContentSettingsMap( | 132 void RemoveExceptionFromHostContentSettingsMap( |
| 130 const base::ListValue* args, | 133 const base::ListValue* args, |
| 131 size_t arg_index, | 134 size_t arg_index, |
| 132 ContentSettingsType type); | 135 ContentSettingsType type); |
| 136 // Removes one zoom level excpetion. |
| 137 void RemoveZoomLevelException(const base::ListValue* args, size_t arg_index); |
| 133 | 138 |
| 134 // Callbacks used by the page ------------------------------------------------ | 139 // Callbacks used by the page ------------------------------------------------ |
| 135 | 140 |
| 136 // Sets the default value for a specific content type. |args| includes the | 141 // 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 | 142 // content type and a string describing the new default the user has |
| 138 // chosen. | 143 // chosen. |
| 139 void SetContentFilter(const base::ListValue* args); | 144 void SetContentFilter(const base::ListValue* args); |
| 140 | 145 |
| 141 // Removes the given row from the table. The first entry in |args| is the | 146 // 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 | 147 // 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(); | 180 void RefreshFlashMediaSettings(); |
| 176 | 181 |
| 177 // Fills in |exceptions| with Values for the given |type| from |map|. | 182 // Fills in |exceptions| with Values for the given |type| from |map|. |
| 178 void GetExceptionsFromHostContentSettingsMap( | 183 void GetExceptionsFromHostContentSettingsMap( |
| 179 const HostContentSettingsMap* map, | 184 const HostContentSettingsMap* map, |
| 180 ContentSettingsType type, | 185 ContentSettingsType type, |
| 181 base::ListValue* exceptions); | 186 base::ListValue* exceptions); |
| 182 | 187 |
| 183 void OnPepperFlashPrefChanged(); | 188 void OnPepperFlashPrefChanged(); |
| 184 | 189 |
| 190 // content::HostZoomMap subscription. |
| 191 void OnZoomLevelChanged(const content::HostZoomMap::ZoomLevelChange& change); |
| 192 |
| 185 void ShowFlashMediaLink(LinkType link_type, bool show); | 193 void ShowFlashMediaLink(LinkType link_type, bool show); |
| 186 | 194 |
| 187 void UpdateFlashMediaLinksVisibility(); | 195 void UpdateFlashMediaLinksVisibility(); |
| 188 | 196 |
| 189 void UpdateProtectedContentExceptionsButton(); | 197 void UpdateProtectedContentExceptionsButton(); |
| 190 | 198 |
| 191 // Member variables --------------------------------------------------------- | 199 // Member variables --------------------------------------------------------- |
| 192 | 200 |
| 193 content::NotificationRegistrar notification_registrar_; | 201 content::NotificationRegistrar notification_registrar_; |
| 194 PrefChangeRegistrar pref_change_registrar_; | 202 PrefChangeRegistrar pref_change_registrar_; |
| 195 scoped_ptr<PepperFlashSettingsManager> flash_settings_manager_; | 203 scoped_ptr<PepperFlashSettingsManager> flash_settings_manager_; |
| 196 MediaSettingsInfo media_settings_; | 204 MediaSettingsInfo media_settings_; |
| 205 scoped_ptr<content::HostZoomMap::Subscription> host_zoom_map_subscription_; |
| 197 | 206 |
| 198 DISALLOW_COPY_AND_ASSIGN(ContentSettingsHandler); | 207 DISALLOW_COPY_AND_ASSIGN(ContentSettingsHandler); |
| 199 }; | 208 }; |
| 200 | 209 |
| 201 } // namespace options | 210 } // namespace options |
| 202 | 211 |
| 203 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CONTENT_SETTINGS_HANDLER_H_ | 212 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CONTENT_SETTINGS_HANDLER_H_ |
| OLD | NEW |