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

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

Issue 2106103006: MD Settings: cr/cros - Guest mode page visibility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments + bug fix Created 4 years, 4 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-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 *
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 url += encodeURIComponent(description); 53 url += encodeURIComponent(description);
54 return url; 54 return url;
55 }, 55 },
56 }, 56 },
57 57
58 /** @private {boolean} */ 58 /** @private {boolean} */
59 toolbarSpinnerActive_: { 59 toolbarSpinnerActive_: {
60 type: Boolean, 60 type: Boolean,
61 value: false, 61 value: false,
62 }, 62 },
63
64 /**
65 * Dictionary defining page visibility.
66 * @private {!GuestModePageVisibility}
67 */
68 pageVisibility_: {
69 type: Object,
70 },
63 }, 71 },
64 72
65 listeners: { 73 listeners: {
66 'sideNav.iron-activate': 'onIronActivate_', 74 'sideNav.iron-activate': 'onIronActivate_',
67 }, 75 },
68 76
77 /** @override */
78 ready: function() {
79 this.$$('cr-toolbar').addEventListener('search-changed', function(e) {
80 this.$$('settings-main').searchContents(e.detail);
81 }.bind(this));
82
83 if (loadTimeData.getBoolean('isGuest')) {
84 this.pageVisibility_ = {
85 people: false,
86 onStartup: false,
87 reset: false,
88 <if expr="not chromeos">
89 appearance: false,
90 defaultBrowser: false,
91 advancedSettings: false,
92 </if>
93 <if expr="chromeos">
94 appearance: true,
95 advancedSettings: true,
96 dateTime: {
97 timeZoneSelector: false,
98 },
99 privacy: {
100 searchPrediction: false,
101 networkPrediction: false,
102 },
103 passwordsAndForms: false,
104 downloads: {
105 googleDrive: false,
106 },
107 </if>
108 };
109
110 <if expr="chromeos">
111 // Cannot be in the object literal or closure_compiler would complain
112 // about duplicate keys.
113 this.pageVisibility_.appearance = {
114 setWallpaper: false,
115 setTheme: false,
116 homeButton: false,
117 bookmarksBar: false,
118 pageZoom: false,
119 };
120 </if>
121 }
122 },
123
69 /** @private */ 124 /** @private */
70 onCloseAppealTap_: function() { 125 onCloseAppealTap_: function() {
71 window.sessionStorage.appealClosed_ = this.appealClosed_ = true; 126 window.sessionStorage.appealClosed_ = this.appealClosed_ = true;
72 }, 127 },
73 128
74 /** 129 /**
75 * @param {Event} event 130 * @param {Event} event
76 * @private 131 * @private
77 */ 132 */
78 onIronActivate_: function(event) { 133 onIronActivate_: function(event) {
79 if (event.detail.item.id != 'advancedPage') 134 if (event.detail.item.id != 'advancedPage')
80 this.$$('app-drawer').close(); 135 this.$$('app-drawer').close();
81 }, 136 },
82 137
83 /** @private */ 138 /** @private */
84 onMenuButtonTap_: function() { 139 onMenuButtonTap_: function() {
85 this.$$('app-drawer').toggle(); 140 this.$$('app-drawer').toggle();
86 }, 141 },
87 142
88 /** @override */
89 ready: function() {
90 this.$$('cr-toolbar').addEventListener('search-changed', function(e) {
91 this.$$('settings-main').searchContents(e.detail);
92 }.bind(this));
93 },
94
95 /** @private */ 143 /** @private */
96 directionDelegateChanged_: function() { 144 directionDelegateChanged_: function() {
97 this.$$('app-drawer').align = this.directionDelegate.isRtl() ? 145 this.$$('app-drawer').align = this.directionDelegate.isRtl() ?
98 'right' : 'left'; 146 'right' : 'left';
99 }, 147 },
100 }); 148 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698