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

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

Issue 2957153003: MD Settings: remove unsupported routes from guest-mode. (Closed)
Patch Set: merge Created 3 years, 5 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
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-privacy-page' is the settings page containing privacy and 7 * 'settings-privacy-page' is the settings page containing privacy and
8 * security settings. 8 * security settings.
9 */ 9 */
10 (function() { 10 (function() {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 return loadTimeData.getBoolean('enableSafeBrowsingSubresourceFilter'); 98 return loadTimeData.getBoolean('enableSafeBrowsingSubresourceFilter');
99 } 99 }
100 }, 100 },
101 101
102 /** @private {!Map<string, string>} */ 102 /** @private {!Map<string, string>} */
103 focusConfig_: { 103 focusConfig_: {
104 type: Object, 104 type: Object,
105 value: function() { 105 value: function() {
106 var map = new Map(); 106 var map = new Map();
107 // <if expr="use_nss_certs"> 107 // <if expr="use_nss_certs">
108 map.set( 108 if (settings.routes.CERTIFICATES) {
109 settings.Route.CERTIFICATES.path, 109 map.set(
110 '#manageCertificates .subpage-arrow'); 110 settings.routes.CERTIFICATES.path,
111 '#manageCertificates .subpage-arrow');
112 }
111 // </if> 113 // </if>
112 map.set( 114 if (settings.routes.SITE_SETTINGS) {
113 settings.Route.SITE_SETTINGS.path, 115 map.set(
114 '#site-settings-subpage-trigger .subpage-arrow'); 116 settings.routes.SITE_SETTINGS.path,
117 '#site-settings-subpage-trigger .subpage-arrow');
118 }
115 return map; 119 return map;
116 }, 120 },
117 }, 121 },
118 }, 122 },
119 123
120 listeners: { 124 listeners: {
121 'doNotTrackDialogIf.dom-change': 'onDoNotTrackDomChange_', 125 'doNotTrackDialogIf.dom-change': 'onDoNotTrackDomChange_',
122 }, 126 },
123 127
124 /** @override */ 128 /** @override */
125 ready: function() { 129 ready: function() {
126 this.ContentSettingsTypes = settings.ContentSettingsTypes; 130 this.ContentSettingsTypes = settings.ContentSettingsTypes;
127 131
128 this.browserProxy_ = settings.PrivacyPageBrowserProxyImpl.getInstance(); 132 this.browserProxy_ = settings.PrivacyPageBrowserProxyImpl.getInstance();
129 133
130 // <if expr="_google_chrome and not chromeos"> 134 // <if expr="_google_chrome and not chromeos">
131 var setMetricsReportingPref = this.setMetricsReportingPref_.bind(this); 135 var setMetricsReportingPref = this.setMetricsReportingPref_.bind(this);
132 this.addWebUIListener('metrics-reporting-change', setMetricsReportingPref); 136 this.addWebUIListener('metrics-reporting-change', setMetricsReportingPref);
133 this.browserProxy_.getMetricsReporting().then(setMetricsReportingPref); 137 this.browserProxy_.getMetricsReporting().then(setMetricsReportingPref);
134 // </if> 138 // </if>
135 139
136 var setSber = this.setSafeBrowsingExtendedReporting_.bind(this); 140 var setSber = this.setSafeBrowsingExtendedReporting_.bind(this);
137 this.addWebUIListener('safe-browsing-extended-reporting-change', setSber); 141 this.addWebUIListener('safe-browsing-extended-reporting-change', setSber);
138 this.browserProxy_.getSafeBrowsingExtendedReporting().then(setSber); 142 this.browserProxy_.getSafeBrowsingExtendedReporting().then(setSber);
139 }, 143 },
140 144
141 /** @protected */ 145 /** @protected */
142 currentRouteChanged: function() { 146 currentRouteChanged: function() {
143 this.showClearBrowsingDataDialog_ = 147 this.showClearBrowsingDataDialog_ =
144 settings.getCurrentRoute() == settings.Route.CLEAR_BROWSER_DATA; 148 settings.getCurrentRoute() == settings.routes.CLEAR_BROWSER_DATA;
145 }, 149 },
146 150
147 /** 151 /**
148 * @param {!Event} event 152 * @param {!Event} event
149 * @private 153 * @private
150 */ 154 */
151 onDoNotTrackDomChange_: function(event) { 155 onDoNotTrackDomChange_: function(event) {
152 if (this.showDoNotTrackDialog_) 156 if (this.showDoNotTrackDialog_)
153 this.maybeShowDoNotTrackDialog_(); 157 this.maybeShowDoNotTrackDialog_();
154 }, 158 },
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 */ 211 */
208 onDoNotTrackDialogCancel_: function() { 212 onDoNotTrackDialogCancel_: function() {
209 /** @type {!SettingsToggleButtonElement} */ (this.$.doNotTrack) 213 /** @type {!SettingsToggleButtonElement} */ (this.$.doNotTrack)
210 .resetToPrefValue(); 214 .resetToPrefValue();
211 this.closeDoNotTrackDialog_(); 215 this.closeDoNotTrackDialog_();
212 }, 216 },
213 217
214 /** @private */ 218 /** @private */
215 onManageCertificatesTap_: function() { 219 onManageCertificatesTap_: function() {
216 // <if expr="use_nss_certs"> 220 // <if expr="use_nss_certs">
217 settings.navigateTo(settings.Route.CERTIFICATES); 221 settings.navigateTo(settings.routes.CERTIFICATES);
218 // </if> 222 // </if>
219 // <if expr="is_win or is_macosx"> 223 // <if expr="is_win or is_macosx">
220 this.browserProxy_.showManageSSLCertificates(); 224 this.browserProxy_.showManageSSLCertificates();
221 // </if> 225 // </if>
222 }, 226 },
223 227
224 /** 228 /**
225 * This is a workaround to connect the remove all button to the subpage. 229 * This is a workaround to connect the remove all button to the subpage.
226 * @private 230 * @private
227 */ 231 */
228 onRemoveAllCookiesFromSite_: function() { 232 onRemoveAllCookiesFromSite_: function() {
229 var node = /** @type {?SiteDataDetailsSubpageElement} */ ( 233 var node = /** @type {?SiteDataDetailsSubpageElement} */ (
230 this.$$('site-data-details-subpage')); 234 this.$$('site-data-details-subpage'));
231 if (node) 235 if (node)
232 node.removeAll(); 236 node.removeAll();
233 }, 237 },
234 238
235 /** @private */ 239 /** @private */
236 onSiteSettingsTap_: function() { 240 onSiteSettingsTap_: function() {
237 settings.navigateTo(settings.Route.SITE_SETTINGS); 241 settings.navigateTo(settings.routes.SITE_SETTINGS);
238 }, 242 },
239 243
240 /** @private */ 244 /** @private */
241 onClearBrowsingDataTap_: function() { 245 onClearBrowsingDataTap_: function() {
242 settings.navigateTo(settings.Route.CLEAR_BROWSER_DATA); 246 settings.navigateTo(settings.routes.CLEAR_BROWSER_DATA);
243 }, 247 },
244 248
245 /** @private */ 249 /** @private */
246 onDialogClosed_: function() { 250 onDialogClosed_: function() {
247 settings.navigateToPreviousRoute(); 251 settings.navigateToPreviousRoute();
248 cr.ui.focusWithoutInk(assert(this.$.clearBrowsingDataTrigger)); 252 cr.ui.focusWithoutInk(assert(this.$.clearBrowsingDataTrigger));
249 }, 253 },
250 254
251 /** @private */ 255 /** @private */
252 onSberChange_: function() { 256 onSberChange_: function() {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 this.i18n('siteSettingsBlocked'); 332 this.i18n('siteSettingsBlocked');
329 }, 333 },
330 334
331 /** @private */ 335 /** @private */
332 getProtectedContentIdentifiersLabel_: function(value) { 336 getProtectedContentIdentifiersLabel_: function(value) {
333 return value ? this.i18n('siteSettingsProtectedContentEnableIdentifiers') : 337 return value ? this.i18n('siteSettingsProtectedContentEnableIdentifiers') :
334 this.i18n('siteSettingsBlocked'); 338 this.i18n('siteSettingsBlocked');
335 }, 339 },
336 }); 340 });
337 })(); 341 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698