| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "components/content_settings/core/common/content_settings_types.h" | 21 #include "components/content_settings/core/common/content_settings_types.h" |
| 22 #include "components/prefs/pref_change_registrar.h" | 22 #include "components/prefs/pref_change_registrar.h" |
| 23 #include "content/public/browser/host_zoom_map.h" | 23 #include "content/public/browser/host_zoom_map.h" |
| 24 #include "content/public/browser/notification_observer.h" | 24 #include "content/public/browser/notification_observer.h" |
| 25 #include "content/public/browser/notification_registrar.h" | 25 #include "content/public/browser/notification_registrar.h" |
| 26 | 26 |
| 27 class HostContentSettingsMap; | 27 class HostContentSettingsMap; |
| 28 class Profile; | 28 class Profile; |
| 29 class ProtocolHandlerRegistry; | 29 class ProtocolHandlerRegistry; |
| 30 | 30 |
| 31 namespace site_settings { |
| 32 struct ChooserTypeNameEntry; |
| 33 } |
| 34 |
| 31 namespace options { | 35 namespace options { |
| 32 | 36 |
| 33 class ContentSettingsHandler : public OptionsPageUIHandler, | 37 class ContentSettingsHandler : public OptionsPageUIHandler, |
| 34 public content_settings::Observer, | 38 public content_settings::Observer, |
| 35 public content::NotificationObserver, | 39 public content::NotificationObserver, |
| 36 public PepperFlashSettingsManager::Client { | 40 public PepperFlashSettingsManager::Client { |
| 37 public: | 41 public: |
| 38 struct ChooserTypeNameEntry; | |
| 39 | |
| 40 ContentSettingsHandler(); | 42 ContentSettingsHandler(); |
| 41 ~ContentSettingsHandler() override; | 43 ~ContentSettingsHandler() override; |
| 42 | 44 |
| 43 // OptionsPageUIHandler implementation. | 45 // OptionsPageUIHandler implementation. |
| 44 void GetLocalizedValues(base::DictionaryValue* localized_strings) override; | 46 void GetLocalizedValues(base::DictionaryValue* localized_strings) override; |
| 45 void InitializeHandler() override; | 47 void InitializeHandler() override; |
| 46 void InitializePage() override; | 48 void InitializePage() override; |
| 47 void RegisterMessages() override; | 49 void RegisterMessages() override; |
| 48 | 50 |
| 49 // content_settings::Observer implementation. | 51 // content_settings::Observer implementation. |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 | 156 |
| 155 // Clobbers and rebuilds all chooser-based exception tables. | 157 // Clobbers and rebuilds all chooser-based exception tables. |
| 156 void UpdateAllChooserExceptionsViewsFromModel(); | 158 void UpdateAllChooserExceptionsViewsFromModel(); |
| 157 | 159 |
| 158 // As above, but only OTR tables. | 160 // As above, but only OTR tables. |
| 159 void UpdateAllOTRChooserExceptionsViewsFromModel(); | 161 void UpdateAllOTRChooserExceptionsViewsFromModel(); |
| 160 | 162 |
| 161 // Clobbers and rebuilds the exception table for a particular chooser-based | 163 // Clobbers and rebuilds the exception table for a particular chooser-based |
| 162 // permission. | 164 // permission. |
| 163 void UpdateChooserExceptionsViewFromModel( | 165 void UpdateChooserExceptionsViewFromModel( |
| 164 const ChooserTypeNameEntry& chooser_type); | 166 const site_settings::ChooserTypeNameEntry& chooser_type); |
| 165 | 167 |
| 166 // As above, but only OTR tables. | 168 // As above, but only OTR tables. |
| 167 void UpdateOTRChooserExceptionsViewFromModel( | 169 void UpdateOTRChooserExceptionsViewFromModel( |
| 168 const ChooserTypeNameEntry& chooser_type); | 170 const site_settings::ChooserTypeNameEntry& chooser_type); |
| 169 | 171 |
| 170 // Modifies the zoom level exceptions list to display correct chrome | 172 // Modifies the zoom level exceptions list to display correct chrome |
| 171 // signin page entry. When the legacy (non-WebView-based) signin page | 173 // signin page entry. When the legacy (non-WebView-based) signin page |
| 172 // goes away, this function can be removed. | 174 // goes away, this function can be removed. |
| 173 void AdjustZoomLevelsListForSigninPageIfNecessary( | 175 void AdjustZoomLevelsListForSigninPageIfNecessary( |
| 174 content::HostZoomMap::ZoomLevelVector* zoom_levels); | 176 content::HostZoomMap::ZoomLevelVector* zoom_levels); |
| 175 | 177 |
| 176 // Clobbers and rebuilds just the zoom levels exception table. | 178 // Clobbers and rebuilds just the zoom levels exception table. |
| 177 void UpdateZoomLevelsExceptionsView(); | 179 void UpdateZoomLevelsExceptionsView(); |
| 178 | 180 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 200 void RemoveExceptionFromHostContentSettingsMap( | 202 void RemoveExceptionFromHostContentSettingsMap( |
| 201 const base::ListValue* args, | 203 const base::ListValue* args, |
| 202 ContentSettingsType type); | 204 ContentSettingsType type); |
| 203 | 205 |
| 204 // Removes one zoom level exception. |args| contains the parameters passed to | 206 // Removes one zoom level exception. |args| contains the parameters passed to |
| 205 // RemoveException(). | 207 // RemoveException(). |
| 206 void RemoveZoomLevelException(const base::ListValue* args); | 208 void RemoveZoomLevelException(const base::ListValue* args); |
| 207 | 209 |
| 208 // Removes one exception for a chooser-based permission. |args| contains the | 210 // Removes one exception for a chooser-based permission. |args| contains the |
| 209 // parameters passed to RemoveException(). | 211 // parameters passed to RemoveException(). |
| 210 void RemoveChooserException(const ChooserTypeNameEntry* chooser_type, | 212 void RemoveChooserException( |
| 211 const base::ListValue* args); | 213 const site_settings::ChooserTypeNameEntry* chooser_type, |
| 214 const base::ListValue* args); |
| 212 | 215 |
| 213 // Callbacks used by the page ------------------------------------------------ | 216 // Callbacks used by the page ------------------------------------------------ |
| 214 | 217 |
| 215 // Sets the default value for a specific content type. |args| includes the | 218 // Sets the default value for a specific content type. |args| includes the |
| 216 // content type and a string describing the new default the user has | 219 // content type and a string describing the new default the user has |
| 217 // chosen. | 220 // chosen. |
| 218 void SetContentFilter(const base::ListValue* args); | 221 void SetContentFilter(const base::ListValue* args); |
| 219 | 222 |
| 220 // Removes the given row from the table. The first entry in |args| is the | 223 // Removes the given row from the table. The first entry in |args| is the |
| 221 // content type, and the rest of the arguments depend on the content type | 224 // content type, and the rest of the arguments depend on the content type |
| (...skipping 19 matching lines...) Expand all Loading... |
| 241 | 244 |
| 242 // Gets the incognito profile, or nullptr if there is no active incognito | 245 // Gets the incognito profile, or nullptr if there is no active incognito |
| 243 // session. | 246 // session. |
| 244 Profile* GetOTRProfile(); | 247 Profile* GetOTRProfile(); |
| 245 | 248 |
| 246 // Gets the ProtocolHandlerRegistry for the normal profile. | 249 // Gets the ProtocolHandlerRegistry for the normal profile. |
| 247 ProtocolHandlerRegistry* GetProtocolHandlerRegistry(); | 250 ProtocolHandlerRegistry* GetProtocolHandlerRegistry(); |
| 248 | 251 |
| 249 void RefreshFlashMediaSettings(); | 252 void RefreshFlashMediaSettings(); |
| 250 | 253 |
| 251 // Fills in |exceptions| with Values for the given |type| from |map|. | |
| 252 void GetChooserExceptionsFromProfile(bool incognito, | |
| 253 const ChooserTypeNameEntry& type, | |
| 254 base::ListValue* exceptions); | |
| 255 | |
| 256 void OnPepperFlashPrefChanged(); | 254 void OnPepperFlashPrefChanged(); |
| 257 | 255 |
| 258 // content::HostZoomMap subscription. | 256 // content::HostZoomMap subscription. |
| 259 void OnZoomLevelChanged(const content::HostZoomMap::ZoomLevelChange& change); | 257 void OnZoomLevelChanged(const content::HostZoomMap::ZoomLevelChange& change); |
| 260 | 258 |
| 261 void ShowFlashMediaLink( | 259 void ShowFlashMediaLink( |
| 262 LinkType link_type, ContentSettingsType content_type, bool show); | 260 LinkType link_type, ContentSettingsType content_type, bool show); |
| 263 | 261 |
| 264 void UpdateFlashMediaLinksVisibility(ContentSettingsType type); | 262 void UpdateFlashMediaLinksVisibility(ContentSettingsType type); |
| 265 | 263 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 278 std::unique_ptr<content::HostZoomMap::Subscription> | 276 std::unique_ptr<content::HostZoomMap::Subscription> |
| 279 signin_host_zoom_map_subscription_; | 277 signin_host_zoom_map_subscription_; |
| 280 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_; | 278 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_; |
| 281 | 279 |
| 282 DISALLOW_COPY_AND_ASSIGN(ContentSettingsHandler); | 280 DISALLOW_COPY_AND_ASSIGN(ContentSettingsHandler); |
| 283 }; | 281 }; |
| 284 | 282 |
| 285 } // namespace options | 283 } // namespace options |
| 286 | 284 |
| 287 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CONTENT_SETTINGS_HANDLER_H_ | 285 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CONTENT_SETTINGS_HANDLER_H_ |
| OLD | NEW |