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

Side by Side Diff: chrome/browser/resources/settings/site_settings_page/site_settings_page.js

Issue 2689303002: MD Settings: Content Settings: Support guest mode. (Closed)
Patch Set: Rebase Created 3 years, 10 months 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 | « chrome/browser/resources/settings/site_settings_page/site_settings_page.html ('k') | no next file » | 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 6 * @fileoverview
7 * 'settings-site-settings-page' is the settings page containing privacy and 7 * 'settings-site-settings-page' is the settings page containing privacy and
8 * security site settings. 8 * security site settings.
9 */ 9 */
10 10
(...skipping 16 matching lines...) Expand all
27 }, 27 },
28 }, 28 },
29 29
30 /** @private */ 30 /** @private */
31 enableSiteSettings_: { 31 enableSiteSettings_: {
32 type: Boolean, 32 type: Boolean,
33 value: function() { 33 value: function() {
34 return loadTimeData.getBoolean('enableSiteSettings'); 34 return loadTimeData.getBoolean('enableSiteSettings');
35 }, 35 },
36 }, 36 },
37
38 /** @private */
39 isGuest_: {
40 type: Boolean,
41 value: function() { return loadTimeData.getBoolean('isGuest'); }
42 },
37 }, 43 },
38 44
39 /** @override */ 45 /** @override */
40 ready: function() { 46 ready: function() {
41 this.ContentSettingsTypes = settings.ContentSettingsTypes; 47 this.ContentSettingsTypes = settings.ContentSettingsTypes;
42 this.ALL_SITES = settings.ALL_SITES; 48 this.ALL_SITES = settings.ALL_SITES;
43 49
44 var keys = Object.keys(settings.ContentSettingsTypes); 50 var keys = Object.keys(settings.ContentSettingsTypes);
45 for (var i = 0; i < keys.length; ++i) { 51 for (var i = 0; i < keys.length; ++i) {
46 var key = settings.ContentSettingsTypes[keys[i]]; 52 var key = settings.ContentSettingsTypes[keys[i]];
47 // Default labels are not applicable to USB and ZOOM. 53 // Default labels are not applicable to USB and ZOOM.
48 if (key == settings.ContentSettingsTypes.USB_DEVICES || 54 if (key == settings.ContentSettingsTypes.USB_DEVICES ||
49 key == settings.ContentSettingsTypes.ZOOM_LEVELS) 55 key == settings.ContentSettingsTypes.ZOOM_LEVELS)
50 continue; 56 continue;
57 // Some values are not available (and will DCHECK) in guest mode.
58 if (this.isGuest_ &&
59 key == settings.ContentSettingsTypes.PROTOCOL_HANDLERS) {
60 continue;
61 }
51 this.updateDefaultValueLabel_(key); 62 this.updateDefaultValueLabel_(key);
52 } 63 }
53 64
54 this.addWebUIListener( 65 this.addWebUIListener(
55 'contentSettingCategoryChanged', 66 'contentSettingCategoryChanged',
56 this.updateDefaultValueLabel_.bind(this)); 67 this.updateDefaultValueLabel_.bind(this));
57 this.addWebUIListener( 68 this.addWebUIListener(
58 'setHandlersEnabled', 69 'setHandlersEnabled',
59 this.updateHandlersEnabled_.bind(this)); 70 this.updateHandlersEnabled_.bind(this));
60 this.browserProxy.observeProtocolHandlersEnabledState(); 71 this.browserProxy.observeProtocolHandlersEnabledState();
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 /** 118 /**
108 * Navigate to the route specified in the event dataset. 119 * Navigate to the route specified in the event dataset.
109 * @param {!Event} event The tap event. 120 * @param {!Event} event The tap event.
110 * @private 121 * @private
111 */ 122 */
112 onTapNavigate_: function(event) { 123 onTapNavigate_: function(event) {
113 var dataSet = /** @type {{route: string}} */(event.currentTarget.dataset); 124 var dataSet = /** @type {{route: string}} */(event.currentTarget.dataset);
114 settings.navigateTo(settings.Route[dataSet.route]); 125 settings.navigateTo(settings.Route[dataSet.route]);
115 }, 126 },
116 }); 127 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/site_settings_page/site_settings_page.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698