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

Side by Side Diff: chrome/browser/resources/settings/site_settings/site_settings_behavior.js

Issue 2457843002: MD Settings: Misc. Site Settings cleanups. (Closed)
Patch Set: fix Created 4 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
« no previous file with comments | « no previous file | chrome/browser/ui/webui/site_settings_helper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 /** 5 /**
6 * @fileoverview Behavior common to Site Settings classes. 6 * @fileoverview Behavior common to Site Settings classes.
7 */ 7 */
8 8
9 /** @polymerBehavior */ 9 /** @polymerBehavior */
10 var SiteSettingsBehaviorImpl = { 10 var SiteSettingsBehaviorImpl = {
(...skipping 15 matching lines...) Expand all
26 created: function() { 26 created: function() {
27 this.browserProxy = 27 this.browserProxy =
28 settings.SiteSettingsPrefsBrowserProxyImpl.getInstance(); 28 settings.SiteSettingsPrefsBrowserProxyImpl.getInstance();
29 }, 29 },
30 30
31 ready: function() { 31 ready: function() {
32 this.PermissionValues = settings.PermissionValues; 32 this.PermissionValues = settings.PermissionValues;
33 }, 33 },
34 34
35 /** 35 /**
36 * A utility function to lookup a category name from its enum. Note: The
37 * category name is visible to the user as part of the URL.
38 * @param {string} category The category ID to look up.
39 * @return {string} The category found or blank string if not found.
40 * @protected
41 */
42 computeCategoryTextId: function(category) {
43 switch (category) {
44 case settings.ContentSettingsTypes.AUTOMATIC_DOWNLOADS:
45 return 'automatic-downloads';
46 case settings.ContentSettingsTypes.BACKGROUND_SYNC:
47 return 'background-sync';
48 case settings.ContentSettingsTypes.CAMERA:
49 return 'camera';
50 case settings.ContentSettingsTypes.COOKIES:
51 return 'cookies';
52 case settings.ContentSettingsTypes.GEOLOCATION:
53 return 'location';
54 case settings.ContentSettingsTypes.IMAGES:
55 return 'images';
56 case settings.ContentSettingsTypes.JAVASCRIPT:
57 return 'javascript';
58 case settings.ContentSettingsTypes.KEYGEN:
59 return 'keygen';
60 case settings.ContentSettingsTypes.MIC:
61 return 'microphone';
62 case settings.ContentSettingsTypes.NOTIFICATIONS:
63 return 'notifications';
64 case settings.ContentSettingsTypes.PLUGINS:
65 return 'plugins';
66 case settings.ContentSettingsTypes.POPUPS:
67 return 'popups';
68 case settings.ContentSettingsTypes.PROTOCOL_HANDLERS:
69 return 'handlers';
70 case settings.ContentSettingsTypes.UNSANDBOXED_PLUGINS:
71 return 'unsandboxed-plugins';
72 case settings.ContentSettingsTypes.USB_DEVICES:
73 return 'usb-devices';
74 case settings.ContentSettingsTypes.ZOOM_LEVELS:
75 return 'zoom-levels';
76 default:
77 return '';
78 }
79 },
80
81 /**
82 * A utility function to lookup the route for a category name. 36 * A utility function to lookup the route for a category name.
83 * @param {string} category The category ID to look up. 37 * @param {string} category The category ID to look up.
84 * @return {!settings.Route} 38 * @return {!settings.Route}
85 * @protected 39 * @protected
86 */ 40 */
87 computeCategoryRoute: function(category) { 41 computeCategoryRoute: function(category) {
88 switch (category) { 42 switch (category) {
89 case settings.ContentSettingsTypes.AUTOMATIC_DOWNLOADS: 43 case settings.ContentSettingsTypes.AUTOMATIC_DOWNLOADS:
90 return settings.Route.SITE_SETTINGS_AUTOMATIC_DOWNLOADS; 44 return settings.Route.SITE_SETTINGS_AUTOMATIC_DOWNLOADS;
91 case settings.ContentSettingsTypes.BACKGROUND_SYNC: 45 case settings.ContentSettingsTypes.BACKGROUND_SYNC:
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 incognito: exception.incognito, 455 incognito: exception.incognito,
502 setting: exception.setting, 456 setting: exception.setting,
503 source: exception.source, 457 source: exception.source,
504 }; 458 };
505 }, 459 },
506 460
507 }; 461 };
508 462
509 /** @polymerBehavior */ 463 /** @polymerBehavior */
510 var SiteSettingsBehavior = [SiteSettingsBehaviorImpl]; 464 var SiteSettingsBehavior = [SiteSettingsBehaviorImpl];
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/site_settings_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698