| 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_OPTIONS2_CONTENT_SETTINGS_HANDLER2_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS2_CONTENT_SETTINGS_HANDLER2_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_CONTENT_SETTINGS_HANDLER2_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_CONTENT_SETTINGS_HANDLER2_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 namespace options2 { | 24 namespace options2 { |
| 25 | 25 |
| 26 class ContentSettingsHandler : public OptionsPageUIHandler, | 26 class ContentSettingsHandler : public OptionsPageUIHandler, |
| 27 public PepperFlashSettingsManager::Client { | 27 public PepperFlashSettingsManager::Client { |
| 28 public: | 28 public: |
| 29 ContentSettingsHandler(); | 29 ContentSettingsHandler(); |
| 30 virtual ~ContentSettingsHandler(); | 30 virtual ~ContentSettingsHandler(); |
| 31 | 31 |
| 32 // OptionsPageUIHandler implementation. | 32 // OptionsPageUIHandler implementation. |
| 33 virtual void GetLocalizedValues(DictionaryValue* localized_strings) OVERRIDE; | 33 virtual void GetLocalizedValues( |
| 34 base::DictionaryValue* localized_strings) OVERRIDE; |
| 34 virtual void InitializeHandler() OVERRIDE; | 35 virtual void InitializeHandler() OVERRIDE; |
| 35 virtual void InitializePage() OVERRIDE; | 36 virtual void InitializePage() OVERRIDE; |
| 36 virtual void RegisterMessages() OVERRIDE; | 37 virtual void RegisterMessages() OVERRIDE; |
| 37 | 38 |
| 38 // content::NotificationObserver implementation. | 39 // content::NotificationObserver implementation. |
| 39 virtual void Observe(int type, | 40 virtual void Observe(int type, |
| 40 const content::NotificationSource& source, | 41 const content::NotificationSource& source, |
| 41 const content::NotificationDetails& details) OVERRIDE; | 42 const content::NotificationDetails& details) OVERRIDE; |
| 42 | 43 |
| 43 // PepperFlashSettingsManager::Client implementation. | 44 // PepperFlashSettingsManager::Client implementation. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 void UpdateMediaStreamExceptionsView(); | 98 void UpdateMediaStreamExceptionsView(); |
| 98 // Clobbers and rebuilds an exception table that's managed by the host content | 99 // Clobbers and rebuilds an exception table that's managed by the host content |
| 99 // settings map. | 100 // settings map. |
| 100 void UpdateExceptionsViewFromHostContentSettingsMap(ContentSettingsType type); | 101 void UpdateExceptionsViewFromHostContentSettingsMap(ContentSettingsType type); |
| 101 // As above, but acts on the OTR table for the content setting type. | 102 // As above, but acts on the OTR table for the content setting type. |
| 102 void UpdateExceptionsViewFromOTRHostContentSettingsMap( | 103 void UpdateExceptionsViewFromOTRHostContentSettingsMap( |
| 103 ContentSettingsType type); | 104 ContentSettingsType type); |
| 104 // Updates the radio buttons for enabling / disabling handlers. | 105 // Updates the radio buttons for enabling / disabling handlers. |
| 105 void UpdateHandlersEnabledRadios(); | 106 void UpdateHandlersEnabledRadios(); |
| 106 // Removes one geolocation exception. | 107 // Removes one geolocation exception. |
| 107 void RemoveGeolocationException(const ListValue* args, size_t arg_index); | 108 void RemoveGeolocationException(const base::ListValue* args, |
| 109 size_t arg_index); |
| 108 // Removes one notification exception. | 110 // Removes one notification exception. |
| 109 void RemoveNotificationException(const ListValue* args, size_t arg_index); | 111 void RemoveNotificationException(const base::ListValue* args, |
| 112 size_t arg_index); |
| 110 // Removes one Pepper Flash camera and microphone exception. | 113 // Removes one Pepper Flash camera and microphone exception. |
| 111 void RemoveFlashCameraMicException(const ListValue* args, size_t arg_index); | 114 void RemoveFlashCameraMicException(const base::ListValue* args, |
| 115 size_t arg_index); |
| 112 // Removes one exception of |type| from the host content settings map. | 116 // Removes one exception of |type| from the host content settings map. |
| 113 void RemoveExceptionFromHostContentSettingsMap( | 117 void RemoveExceptionFromHostContentSettingsMap( |
| 114 const ListValue* args, | 118 const base::ListValue* args, |
| 115 size_t arg_index, | 119 size_t arg_index, |
| 116 const ExContentSettingsType& type); | 120 const ExContentSettingsType& type); |
| 117 | 121 |
| 118 // Callbacks used by the page ------------------------------------------------ | 122 // Callbacks used by the page ------------------------------------------------ |
| 119 | 123 |
| 120 // Sets the default value for a specific content type. |args| includes the | 124 // Sets the default value for a specific content type. |args| includes the |
| 121 // content type and a string describing the new default the user has | 125 // content type and a string describing the new default the user has |
| 122 // chosen. | 126 // chosen. |
| 123 void SetContentFilter(const ListValue* args); | 127 void SetContentFilter(const base::ListValue* args); |
| 124 | 128 |
| 125 // Removes the given row from the table. The first entry in |args| is the | 129 // Removes the given row from the table. The first entry in |args| is the |
| 126 // content type, and the rest of the arguments depend on the content type | 130 // content type, and the rest of the arguments depend on the content type |
| 127 // to be removed. | 131 // to be removed. |
| 128 void RemoveException(const ListValue* args); | 132 void RemoveException(const base::ListValue* args); |
| 129 | 133 |
| 130 // Changes the value of an exception. Called after the user is done editing an | 134 // Changes the value of an exception. Called after the user is done editing an |
| 131 // exception. | 135 // exception. |
| 132 void SetException(const ListValue* args); | 136 void SetException(const base::ListValue* args); |
| 133 | 137 |
| 134 // Called to decide whether a given pattern is valid, or if it should be | 138 // Called to decide whether a given pattern is valid, or if it should be |
| 135 // rejected. Called while the user is editing an exception pattern. | 139 // rejected. Called while the user is editing an exception pattern. |
| 136 void CheckExceptionPatternValidity(const ListValue* args); | 140 void CheckExceptionPatternValidity(const base::ListValue* args); |
| 137 | 141 |
| 138 // Utility functions --------------------------------------------------------- | 142 // Utility functions --------------------------------------------------------- |
| 139 | 143 |
| 140 // Applies content settings whitelists to reduce breakage / user confusion. | 144 // Applies content settings whitelists to reduce breakage / user confusion. |
| 141 void ApplyWhitelist(ContentSettingsType content_type, | 145 void ApplyWhitelist(ContentSettingsType content_type, |
| 142 ContentSetting default_setting); | 146 ContentSetting default_setting); |
| 143 | 147 |
| 144 // Gets the HostContentSettingsMap for the normal profile. | 148 // Gets the HostContentSettingsMap for the normal profile. |
| 145 HostContentSettingsMap* GetContentSettingsMap(); | 149 HostContentSettingsMap* GetContentSettingsMap(); |
| 146 | 150 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 174 | 178 |
| 175 static const ExContentSettingsTypeNameEntry | 179 static const ExContentSettingsTypeNameEntry |
| 176 kExContentSettingsTypeGroupNames[]; | 180 kExContentSettingsTypeGroupNames[]; |
| 177 | 181 |
| 178 DISALLOW_COPY_AND_ASSIGN(ContentSettingsHandler); | 182 DISALLOW_COPY_AND_ASSIGN(ContentSettingsHandler); |
| 179 }; | 183 }; |
| 180 | 184 |
| 181 } // namespace options2 | 185 } // namespace options2 |
| 182 | 186 |
| 183 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_CONTENT_SETTINGS_HANDLER2_H_ | 187 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_CONTENT_SETTINGS_HANDLER2_H_ |
| OLD | NEW |