Chromium Code Reviews| 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" |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 class HostContentSettingsMap; | 24 class HostContentSettingsMap; |
| 25 class ProtocolHandlerRegistry; | 25 class ProtocolHandlerRegistry; |
| 26 | 26 |
| 27 namespace options { | 27 namespace options { |
| 28 | 28 |
| 29 class ContentSettingsHandler : public OptionsPageUIHandler, | 29 class ContentSettingsHandler : public OptionsPageUIHandler, |
| 30 public content_settings::Observer, | 30 public content_settings::Observer, |
| 31 public content::NotificationObserver, | 31 public content::NotificationObserver, |
| 32 public PepperFlashSettingsManager::Client { | 32 public PepperFlashSettingsManager::Client { |
| 33 public: | 33 public: |
| 34 struct ChooserTypeNameEntry; | |
|
Bernhard Bauer
2015/11/18 14:11:06
This can't be in the private section because it's
| |
| 35 | |
| 34 ContentSettingsHandler(); | 36 ContentSettingsHandler(); |
| 35 ~ContentSettingsHandler() override; | 37 ~ContentSettingsHandler() override; |
| 36 | 38 |
| 37 // OptionsPageUIHandler implementation. | 39 // OptionsPageUIHandler implementation. |
| 38 void GetLocalizedValues(base::DictionaryValue* localized_strings) override; | 40 void GetLocalizedValues(base::DictionaryValue* localized_strings) override; |
| 39 void InitializeHandler() override; | 41 void InitializeHandler() override; |
| 40 void InitializePage() override; | 42 void InitializePage() override; |
| 41 void RegisterMessages() override; | 43 void RegisterMessages() override; |
| 42 | 44 |
| 43 // content_settings::Observer implementation. | 45 // content_settings::Observer implementation. |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 // Clobbers and rebuilds just the desktop notification exception table. | 144 // Clobbers and rebuilds just the desktop notification exception table. |
| 143 void UpdateNotificationExceptionsView(); | 145 void UpdateNotificationExceptionsView(); |
| 144 | 146 |
| 145 // Compares the exceptions of the camera or microphone |type| with its Flash | 147 // Compares the exceptions of the camera or microphone |type| with its Flash |
| 146 // counterparts and updates the Flash links' visibility accordingly. | 148 // counterparts and updates the Flash links' visibility accordingly. |
| 147 void CompareMediaExceptionsWithFlash(ContentSettingsType type); | 149 void CompareMediaExceptionsWithFlash(ContentSettingsType type); |
| 148 | 150 |
| 149 // Clobbers and rebuilds just the MIDI SysEx exception table. | 151 // Clobbers and rebuilds just the MIDI SysEx exception table. |
| 150 void UpdateMIDISysExExceptionsView(); | 152 void UpdateMIDISysExExceptionsView(); |
| 151 | 153 |
| 154 // Clobbers and rebuilds all chooser-based exception tables. | |
| 155 void UpdateAllChooserExceptionsViewsFromModel(); | |
| 156 | |
| 157 // Clobbers and rebuilds the exception table for a particular chooser-based | |
| 158 // permission. | |
| 159 void UpdateChooserExceptionsViewFromModel( | |
| 160 const ChooserTypeNameEntry& chooser_type); | |
| 161 | |
| 152 // Modifies the zoom level exceptions list to display correct chrome | 162 // Modifies the zoom level exceptions list to display correct chrome |
| 153 // signin page entry. When the legacy (non-WebView-based) signin page | 163 // signin page entry. When the legacy (non-WebView-based) signin page |
| 154 // goes away, this function can be removed. | 164 // goes away, this function can be removed. |
| 155 void AdjustZoomLevelsListForSigninPageIfNecessary( | 165 void AdjustZoomLevelsListForSigninPageIfNecessary( |
| 156 content::HostZoomMap::ZoomLevelVector* zoom_levels); | 166 content::HostZoomMap::ZoomLevelVector* zoom_levels); |
| 157 | 167 |
| 158 // Clobbers and rebuilds just the zoom levels exception table. | 168 // Clobbers and rebuilds just the zoom levels exception table. |
| 159 void UpdateZoomLevelsExceptionsView(); | 169 void UpdateZoomLevelsExceptionsView(); |
| 160 | 170 |
| 161 // Clobbers and rebuilds an exception table that's managed by the host content | 171 // Clobbers and rebuilds an exception table that's managed by the host content |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 180 // Removes one exception of |type| from the host content settings map. |args| | 190 // Removes one exception of |type| from the host content settings map. |args| |
| 181 // contains the parameters passed to RemoveException(). | 191 // contains the parameters passed to RemoveException(). |
| 182 void RemoveExceptionFromHostContentSettingsMap( | 192 void RemoveExceptionFromHostContentSettingsMap( |
| 183 const base::ListValue* args, | 193 const base::ListValue* args, |
| 184 ContentSettingsType type); | 194 ContentSettingsType type); |
| 185 | 195 |
| 186 // Removes one zoom level exception. |args| contains the parameters passed to | 196 // Removes one zoom level exception. |args| contains the parameters passed to |
| 187 // RemoveException(). | 197 // RemoveException(). |
| 188 void RemoveZoomLevelException(const base::ListValue* args); | 198 void RemoveZoomLevelException(const base::ListValue* args); |
| 189 | 199 |
| 200 // Removes one exception for a chooser-based permission. |args| contains the | |
| 201 // parameters passed to RemoveException(). | |
| 202 void RemoveChooserException(const ChooserTypeNameEntry* chooser_type, | |
| 203 const base::ListValue* args); | |
| 204 | |
| 190 // Callbacks used by the page ------------------------------------------------ | 205 // Callbacks used by the page ------------------------------------------------ |
| 191 | 206 |
| 192 // Sets the default value for a specific content type. |args| includes the | 207 // Sets the default value for a specific content type. |args| includes the |
| 193 // content type and a string describing the new default the user has | 208 // content type and a string describing the new default the user has |
| 194 // chosen. | 209 // chosen. |
| 195 void SetContentFilter(const base::ListValue* args); | 210 void SetContentFilter(const base::ListValue* args); |
| 196 | 211 |
| 197 // Removes the given row from the table. The first entry in |args| is the | 212 // Removes the given row from the table. The first entry in |args| is the |
| 198 // content type, and the rest of the arguments depend on the content type | 213 // content type, and the rest of the arguments depend on the content type |
| 199 // to be removed. | 214 // to be removed. |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 220 // is no active incognito session. | 235 // is no active incognito session. |
| 221 HostContentSettingsMap* GetOTRContentSettingsMap(); | 236 HostContentSettingsMap* GetOTRContentSettingsMap(); |
| 222 | 237 |
| 223 // Gets the ProtocolHandlerRegistry for the normal profile. | 238 // Gets the ProtocolHandlerRegistry for the normal profile. |
| 224 ProtocolHandlerRegistry* GetProtocolHandlerRegistry(); | 239 ProtocolHandlerRegistry* GetProtocolHandlerRegistry(); |
| 225 | 240 |
| 226 void RefreshFlashMediaSettings(); | 241 void RefreshFlashMediaSettings(); |
| 227 | 242 |
| 228 // Returns exceptions constructed from the policy-set allowed URLs | 243 // Returns exceptions constructed from the policy-set allowed URLs |
| 229 // for the content settings |type| mic or camera. | 244 // for the content settings |type| mic or camera. |
| 230 scoped_ptr<base::ListValue> GetPolicyAllowedUrls(ContentSettingsType type); | 245 void GetPolicyAllowedUrls( |
| 246 ContentSettingsType type, | |
| 247 std::vector<scoped_ptr<base::DictionaryValue>>* exceptions); | |
| 231 | 248 |
| 232 // Fills in |exceptions| with Values for the given |type| from |map|. | 249 // Fills in |exceptions| with Values for the given |type| from |map|. |
| 233 void GetExceptionsFromHostContentSettingsMap( | 250 void GetExceptionsFromHostContentSettingsMap( |
| 234 const HostContentSettingsMap* map, | 251 const HostContentSettingsMap* map, |
| 235 ContentSettingsType type, | 252 ContentSettingsType type, |
| 236 base::ListValue* exceptions); | 253 base::ListValue* exceptions); |
| 237 | 254 |
| 238 void OnPepperFlashPrefChanged(); | 255 void OnPepperFlashPrefChanged(); |
| 239 | 256 |
| 240 // content::HostZoomMap subscription. | 257 // content::HostZoomMap subscription. |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 259 scoped_ptr<content::HostZoomMap::Subscription> | 276 scoped_ptr<content::HostZoomMap::Subscription> |
| 260 signin_host_zoom_map_subscription_; | 277 signin_host_zoom_map_subscription_; |
| 261 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_; | 278 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_; |
| 262 | 279 |
| 263 DISALLOW_COPY_AND_ASSIGN(ContentSettingsHandler); | 280 DISALLOW_COPY_AND_ASSIGN(ContentSettingsHandler); |
| 264 }; | 281 }; |
| 265 | 282 |
| 266 } // namespace options | 283 } // namespace options |
| 267 | 284 |
| 268 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CONTENT_SETTINGS_HANDLER_H_ | 285 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CONTENT_SETTINGS_HANDLER_H_ |
| OLD | NEW |