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

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

Issue 2406043002: MD Settings: Prevent <settings-prefs> from being initialized in guest mode. (Closed)
Patch Set: Created 4 years, 2 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/settings_ui/settings_ui.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-ui' implements the UI for the Settings page. 7 * 'settings-ui' implements the UI for the Settings page.
8 * 8 *
9 * Example: 9 * Example:
10 * 10 *
11 * <settings-ui prefs="{{prefs}}"></settings-ui> 11 * <settings-ui prefs="{{prefs}}"></settings-ui>
12 */ 12 */
13 cr.exportPath('settings'); 13 cr.exportPath('settings');
14 assert(!settings.defaultResourceLoaded, 14 assert(!settings.defaultResourceLoaded,
15 'settings_ui.js run twice. You probably have an invalid import.'); 15 'settings_ui.js run twice. You probably have an invalid import.');
16 /** Global defined when the main Settings script runs. */ 16 /** Global defined when the main Settings script runs. */
17 settings.defaultResourceLoaded = true; 17 settings.defaultResourceLoaded = true;
18 18
19 Polymer({ 19 Polymer({
20 is: 'settings-ui', 20 is: 'settings-ui',
21 21
22 properties: { 22 properties: {
23 /** 23 /**
24 * Preferences state. 24 * Preferences state.
25 */ 25 */
26 prefs: Object, 26 prefs: Object,
27 27
28 /** @private */
29 isGuestMode_: {
30 type: Boolean,
31 value: loadTimeData.getBoolean('isGuest'),
32 },
33
28 /** @type {?settings.DirectionDelegate} */ 34 /** @type {?settings.DirectionDelegate} */
29 directionDelegate: { 35 directionDelegate: {
30 observer: 'directionDelegateChanged_', 36 observer: 'directionDelegateChanged_',
31 type: Object, 37 type: Object,
32 value: new settings.DirectionDelegateImpl(), 38 value: new settings.DirectionDelegateImpl(),
33 }, 39 },
34 40
35 /** @private {boolean} */ 41 /** @private {boolean} */
36 toolbarSpinnerActive_: { 42 toolbarSpinnerActive_: {
37 type: Boolean, 43 type: Boolean,
(...skipping 25 matching lines...) Expand all
63 // Lazy-create the drawer the first time it is opened or swiped into view. 69 // Lazy-create the drawer the first time it is opened or swiped into view.
64 var drawer = assert(this.$$('app-drawer')); 70 var drawer = assert(this.$$('app-drawer'));
65 listenOnce(drawer, 'track opened-changed', function() { 71 listenOnce(drawer, 'track opened-changed', function() {
66 this.$.drawerTemplate.if = true; 72 this.$.drawerTemplate.if = true;
67 }.bind(this)); 73 }.bind(this));
68 74
69 window.addEventListener('popstate', function(e) { 75 window.addEventListener('popstate', function(e) {
70 drawer.close(); 76 drawer.close();
71 }.bind(this)); 77 }.bind(this));
72 78
73 if (loadTimeData.getBoolean('isGuest')) { 79 if (this.isGuestMode_) {
74 this.pageVisibility_ = { 80 this.pageVisibility_ = {
75 people: false, 81 people: false,
76 onStartup: false, 82 onStartup: false,
77 reset: false, 83 reset: false,
78 <if expr="not chromeos"> 84 <if expr="not chromeos">
79 appearance: false, 85 appearance: false,
80 defaultBrowser: false, 86 defaultBrowser: false,
81 advancedSettings: false, 87 advancedSettings: false,
82 </if> 88 </if>
83 <if expr="chromeos"> 89 <if expr="chromeos">
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 onMenuButtonTap_: function() { 127 onMenuButtonTap_: function() {
122 this.$$('app-drawer').toggle(); 128 this.$$('app-drawer').toggle();
123 }, 129 },
124 130
125 /** @private */ 131 /** @private */
126 directionDelegateChanged_: function() { 132 directionDelegateChanged_: function() {
127 this.$$('app-drawer').align = this.directionDelegate.isRtl() ? 133 this.$$('app-drawer').align = this.directionDelegate.isRtl() ?
128 'right' : 'left'; 134 'right' : 'left';
129 }, 135 },
130 }); 136 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/settings_ui/settings_ui.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698