Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: chrome/browser/ui/webui/options/content_settings_handler.h

Issue 1447813002: Add USB devices to the content settings page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@get_all_objects
Patch Set: NodeList.prototype does not include forEach. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/scoped_observer.h" 12 #include "base/scoped_observer.h"
13 #include "base/values.h" 13 #include "base/values.h"
14 #include "chrome/browser/pepper_flash_settings_manager.h" 14 #include "chrome/browser/pepper_flash_settings_manager.h"
15 #include "chrome/browser/ui/webui/options/options_ui.h" 15 #include "chrome/browser/ui/webui/options/options_ui.h"
16 #include "chrome/browser/ui/webui/options/pepper_flash_content_settings_utils.h" 16 #include "chrome/browser/ui/webui/options/pepper_flash_content_settings_utils.h"
17 #include "components/content_settings/core/browser/content_settings_observer.h" 17 #include "components/content_settings/core/browser/content_settings_observer.h"
18 #include "components/content_settings/core/common/content_settings.h" 18 #include "components/content_settings/core/common/content_settings.h"
19 #include "components/content_settings/core/common/content_settings_types.h" 19 #include "components/content_settings/core/common/content_settings_types.h"
20 #include "content/public/browser/host_zoom_map.h" 20 #include "content/public/browser/host_zoom_map.h"
21 #include "content/public/browser/notification_observer.h" 21 #include "content/public/browser/notification_observer.h"
22 #include "content/public/browser/notification_registrar.h" 22 #include "content/public/browser/notification_registrar.h"
23 23
24 struct ChooserTypeNameEntry;
24 class HostContentSettingsMap; 25 class HostContentSettingsMap;
25 class ProtocolHandlerRegistry; 26 class ProtocolHandlerRegistry;
26 27
27 namespace options { 28 namespace options {
28 29
29 class ContentSettingsHandler : public OptionsPageUIHandler, 30 class ContentSettingsHandler : public OptionsPageUIHandler,
30 public content_settings::Observer, 31 public content_settings::Observer,
31 public content::NotificationObserver, 32 public content::NotificationObserver,
32 public PepperFlashSettingsManager::Client { 33 public PepperFlashSettingsManager::Client {
33 public: 34 public:
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 // Clobbers and rebuilds just the desktop notification exception table. 143 // Clobbers and rebuilds just the desktop notification exception table.
143 void UpdateNotificationExceptionsView(); 144 void UpdateNotificationExceptionsView();
144 145
145 // Compares the exceptions of the camera or microphone |type| with its Flash 146 // Compares the exceptions of the camera or microphone |type| with its Flash
146 // counterparts and updates the Flash links' visibility accordingly. 147 // counterparts and updates the Flash links' visibility accordingly.
147 void CompareMediaExceptionsWithFlash(ContentSettingsType type); 148 void CompareMediaExceptionsWithFlash(ContentSettingsType type);
148 149
149 // Clobbers and rebuilds just the MIDI SysEx exception table. 150 // Clobbers and rebuilds just the MIDI SysEx exception table.
150 void UpdateMIDISysExExceptionsView(); 151 void UpdateMIDISysExExceptionsView();
151 152
153 // Clobbers and rebuilds all chooser-based exception tables.
154 void UpdateAllChooserExceptionsViewsFromModel();
155
156 // Clobbers and rebuilds the exception table for a particular chooser-based
157 // permission.
158 void UpdateChooserExceptionsViewFromModel(
159 const ChooserTypeNameEntry& chooser_type);
160
152 // Modifies the zoom level exceptions list to display correct chrome 161 // Modifies the zoom level exceptions list to display correct chrome
153 // signin page entry. When the legacy (non-WebView-based) signin page 162 // signin page entry. When the legacy (non-WebView-based) signin page
154 // goes away, this function can be removed. 163 // goes away, this function can be removed.
155 void AdjustZoomLevelsListForSigninPageIfNecessary( 164 void AdjustZoomLevelsListForSigninPageIfNecessary(
156 content::HostZoomMap::ZoomLevelVector* zoom_levels); 165 content::HostZoomMap::ZoomLevelVector* zoom_levels);
157 166
158 // Clobbers and rebuilds just the zoom levels exception table. 167 // Clobbers and rebuilds just the zoom levels exception table.
159 void UpdateZoomLevelsExceptionsView(); 168 void UpdateZoomLevelsExceptionsView();
160 169
161 // Clobbers and rebuilds an exception table that's managed by the host content 170 // Clobbers and rebuilds an exception table that's managed by the host content
(...skipping 18 matching lines...) Expand all
180 // Removes one exception of |type| from the host content settings map. |args| 189 // Removes one exception of |type| from the host content settings map. |args|
181 // contains the parameters passed to RemoveException(). 190 // contains the parameters passed to RemoveException().
182 void RemoveExceptionFromHostContentSettingsMap( 191 void RemoveExceptionFromHostContentSettingsMap(
183 const base::ListValue* args, 192 const base::ListValue* args,
184 ContentSettingsType type); 193 ContentSettingsType type);
185 194
186 // Removes one zoom level exception. |args| contains the parameters passed to 195 // Removes one zoom level exception. |args| contains the parameters passed to
187 // RemoveException(). 196 // RemoveException().
188 void RemoveZoomLevelException(const base::ListValue* args); 197 void RemoveZoomLevelException(const base::ListValue* args);
189 198
199 // Removes one exception for a chooser-based permission. |args| contains the
200 // parameters passed to RemoveException().
201 void RemoveChooserException(const ChooserTypeNameEntry* chooser_type,
202 const base::ListValue* args);
203
190 // Callbacks used by the page ------------------------------------------------ 204 // Callbacks used by the page ------------------------------------------------
191 205
192 // Sets the default value for a specific content type. |args| includes the 206 // 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 207 // content type and a string describing the new default the user has
194 // chosen. 208 // chosen.
195 void SetContentFilter(const base::ListValue* args); 209 void SetContentFilter(const base::ListValue* args);
196 210
197 // Removes the given row from the table. The first entry in |args| is the 211 // 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 212 // content type, and the rest of the arguments depend on the content type
199 // to be removed. 213 // to be removed.
(...skipping 20 matching lines...) Expand all
220 // is no active incognito session. 234 // is no active incognito session.
221 HostContentSettingsMap* GetOTRContentSettingsMap(); 235 HostContentSettingsMap* GetOTRContentSettingsMap();
222 236
223 // Gets the ProtocolHandlerRegistry for the normal profile. 237 // Gets the ProtocolHandlerRegistry for the normal profile.
224 ProtocolHandlerRegistry* GetProtocolHandlerRegistry(); 238 ProtocolHandlerRegistry* GetProtocolHandlerRegistry();
225 239
226 void RefreshFlashMediaSettings(); 240 void RefreshFlashMediaSettings();
227 241
228 // Returns exceptions constructed from the policy-set allowed URLs 242 // Returns exceptions constructed from the policy-set allowed URLs
229 // for the content settings |type| mic or camera. 243 // for the content settings |type| mic or camera.
230 scoped_ptr<base::ListValue> GetPolicyAllowedUrls(ContentSettingsType type); 244 void GetPolicyAllowedUrls(
245 ContentSettingsType type,
246 std::vector<scoped_ptr<base::DictionaryValue>>* exceptions);
231 247
232 // Fills in |exceptions| with Values for the given |type| from |map|. 248 // Fills in |exceptions| with Values for the given |type| from |map|.
233 void GetExceptionsFromHostContentSettingsMap( 249 void GetExceptionsFromHostContentSettingsMap(
234 const HostContentSettingsMap* map, 250 const HostContentSettingsMap* map,
235 ContentSettingsType type, 251 ContentSettingsType type,
236 base::ListValue* exceptions); 252 base::ListValue* exceptions);
237 253
238 void OnPepperFlashPrefChanged(); 254 void OnPepperFlashPrefChanged();
239 255
240 // content::HostZoomMap subscription. 256 // content::HostZoomMap subscription.
(...skipping 18 matching lines...) Expand all
259 scoped_ptr<content::HostZoomMap::Subscription> 275 scoped_ptr<content::HostZoomMap::Subscription>
260 signin_host_zoom_map_subscription_; 276 signin_host_zoom_map_subscription_;
261 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_; 277 ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_;
262 278
263 DISALLOW_COPY_AND_ASSIGN(ContentSettingsHandler); 279 DISALLOW_COPY_AND_ASSIGN(ContentSettingsHandler);
264 }; 280 };
265 281
266 } // namespace options 282 } // namespace options
267 283
268 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CONTENT_SETTINGS_HANDLER_H_ 284 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CONTENT_SETTINGS_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698