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

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

Issue 2964293002: CrOS Settings: Add skeleton page for multidevice section. (Closed)
Patch Set: Minor cleanups 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-basic-page' is the settings page containing the actual settings. 7 * 'settings-basic-page' is the settings page containing the actual settings.
8 */ 8 */
9 Polymer({ 9 Polymer({
10 is: 'settings-basic-page', 10 is: 'settings-basic-page',
11 11
12 behaviors: [MainPageBehavior, WebUIListenerBehavior], 12 behaviors: [MainPageBehavior, WebUIListenerBehavior],
13 13
14 properties: { 14 properties: {
15 /** Preferences state. */ 15 /** Preferences state. */
16 prefs: { 16 prefs: {
17 type: Object, 17 type: Object,
18 notify: true, 18 notify: true,
19 }, 19 },
20 20
21 showAndroidApps: Boolean, 21 showAndroidApps: Boolean,
dpapad 2017/07/06 01:26:50 Should lines 21-25 be wrapped in an <if expr="chro
Oren Blasberg 2017/07/06 18:17:58 Done. Btw, how does that work, if it's commented o
dpapad 2017/07/06 18:59:02 Yes. GRIT is preprocessing those, see https://cs.c
22 22
23 showMultidevice: Boolean,
24
23 havePlayStoreApp: Boolean, 25 havePlayStoreApp: Boolean,
24 26
25 /** @type {!AndroidAppsInfo|undefined} */ 27 /** @type {!AndroidAppsInfo|undefined} */
26 androidAppsInfo: Object, 28 androidAppsInfo: Object,
27 29
28 showChromeCleanup: { 30 showChromeCleanup: {
29 type: Boolean, 31 type: Boolean,
30 value: function() { 32 value: function() {
31 return loadTimeData.valueExists('chromeCleanupEnabled') && 33 return loadTimeData.valueExists('chromeCleanupEnabled') &&
32 loadTimeData.getBoolean('chromeCleanupEnabled'); 34 loadTimeData.getBoolean('chromeCleanupEnabled');
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 178
177 // <if expr="chromeos"> 179 // <if expr="chromeos">
178 /** 180 /**
179 * @return {boolean} 181 * @return {boolean}
180 * @private 182 * @private
181 */ 183 */
182 computeShowSecondaryUserBanner_: function() { 184 computeShowSecondaryUserBanner_: function() {
183 return !this.hasExpandedSection_ && 185 return !this.hasExpandedSection_ &&
184 loadTimeData.getBoolean('isSecondaryUser'); 186 loadTimeData.getBoolean('isSecondaryUser');
185 }, 187 },
188
189 /**
190 * Whether to show the multidevice settings page.
191 * @param {boolean|undefined} visibility
192 * @return {boolean}
dpapad 2017/07/06 01:26:50 Nit: Move comment from line 190 to here, as @retur
Oren Blasberg 2017/07/06 18:17:58 Done.
193 * @private
194 */
195 showMultidevicePage_: function(visibility) {
dpapad 2017/07/06 01:26:50 Where is this used?
Oren Blasberg 2017/07/06 18:17:58 Oops. It was superseded by shouldShowMultidevice_
196 return loadTimeData.getBoolean('enableMultideviceSettings') &&
197 this.showPage_(visibility);
198 },
186 // </if> 199 // </if>
187 200
188 /** @private */ 201 /** @private */
189 onResetProfileBannerClosed_: function() { 202 onResetProfileBannerClosed_: function() {
190 this.showResetProfileBanner_ = false; 203 this.showResetProfileBanner_ = false;
191 }, 204 },
192 205
193 /** 206 /**
194 * @param {!AndroidAppsInfo} info 207 * @param {!AndroidAppsInfo} info
195 * @private 208 * @private
(...skipping 17 matching lines...) Expand all
213 // settings app is not yet available. 226 // settings app is not yet available.
214 if (!this.havePlayStoreApp && 227 if (!this.havePlayStoreApp &&
215 (!this.androidAppsInfo || !this.androidAppsInfo.settingsAppAvailable)) { 228 (!this.androidAppsInfo || !this.androidAppsInfo.settingsAppAvailable)) {
216 return false; 229 return false;
217 } 230 }
218 231
219 return true; 232 return true;
220 }, 233 },
221 234
222 /** 235 /**
236 * @return {boolean}
237 * @private
238 */
239 shouldShowMultidevice_: function() {
240 var visibility = /** @type {boolean|undefined} */ (
241 this.get('pageVisibility.multidevice'));
242 return this.showMultidevice && this.showPage_(visibility);
243 },
244
245 /**
223 * Hides everything but the newly expanded subpage. 246 * Hides everything but the newly expanded subpage.
224 * @private 247 * @private
225 */ 248 */
226 onSubpageExpanded_: function() { 249 onSubpageExpanded_: function() {
227 this.hasExpandedSection_ = true; 250 this.hasExpandedSection_ = true;
228 }, 251 },
229 252
230 /** 253 /**
231 * Render the advanced page now (don't wait for idle). 254 * Render the advanced page now (don't wait for idle).
232 * @private 255 * @private
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 310
288 /** 311 /**
289 * @param {boolean} opened Whether the menu is expanded. 312 * @param {boolean} opened Whether the menu is expanded.
290 * @return {string} Icon name. 313 * @return {string} Icon name.
291 * @private 314 * @private
292 */ 315 */
293 getArrowIcon_: function(opened) { 316 getArrowIcon_: function(opened) {
294 return opened ? 'cr:arrow-drop-up' : 'cr:arrow-drop-down'; 317 return opened ? 'cr:arrow-drop-up' : 'cr:arrow-drop-down';
295 }, 318 },
296 }); 319 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698