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

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: Update browsertest 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 // <if expr="chromeos">
21 showAndroidApps: Boolean, 22 showAndroidApps: Boolean,
22 23
24 showMultidevice: Boolean,
25
23 havePlayStoreApp: Boolean, 26 havePlayStoreApp: Boolean,
27 // </if>
24 28
25 /** @type {!AndroidAppsInfo|undefined} */ 29 /** @type {!AndroidAppsInfo|undefined} */
26 androidAppsInfo: Object, 30 androidAppsInfo: Object,
27 31
28 showChromeCleanup: { 32 showChromeCleanup: {
29 type: Boolean, 33 type: Boolean,
30 value: function() { 34 value: function() {
31 return loadTimeData.valueExists('chromeCleanupEnabled') && 35 return loadTimeData.valueExists('chromeCleanupEnabled') &&
32 loadTimeData.getBoolean('chromeCleanupEnabled'); 36 loadTimeData.getBoolean('chromeCleanupEnabled');
33 }, 37 },
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 180
177 // <if expr="chromeos"> 181 // <if expr="chromeos">
178 /** 182 /**
179 * @return {boolean} 183 * @return {boolean}
180 * @private 184 * @private
181 */ 185 */
182 computeShowSecondaryUserBanner_: function() { 186 computeShowSecondaryUserBanner_: function() {
183 return !this.hasExpandedSection_ && 187 return !this.hasExpandedSection_ &&
184 loadTimeData.getBoolean('isSecondaryUser'); 188 loadTimeData.getBoolean('isSecondaryUser');
185 }, 189 },
190
191 /**
192 * @param {boolean|undefined} visibility
193 * @return {boolean} Whether to show the multidevice settings page.
194 * @private
195 */
196 showMultidevicePage_: function(visibility) {
dpapad 2017/07/06 18:59:02 Still here.
Oren Blasberg 2017/07/06 19:20:30 Done.
197 return loadTimeData.getBoolean('enableMultideviceSettings') &&
198 this.showPage_(visibility);
199 },
186 // </if> 200 // </if>
187 201
188 /** @private */ 202 /** @private */
189 onResetProfileBannerClosed_: function() { 203 onResetProfileBannerClosed_: function() {
190 this.showResetProfileBanner_ = false; 204 this.showResetProfileBanner_ = false;
191 }, 205 },
192 206
193 /** 207 /**
194 * @param {!AndroidAppsInfo} info 208 * @param {!AndroidAppsInfo} info
195 * @private 209 * @private
(...skipping 17 matching lines...) Expand all
213 // settings app is not yet available. 227 // settings app is not yet available.
214 if (!this.havePlayStoreApp && 228 if (!this.havePlayStoreApp &&
215 (!this.androidAppsInfo || !this.androidAppsInfo.settingsAppAvailable)) { 229 (!this.androidAppsInfo || !this.androidAppsInfo.settingsAppAvailable)) {
216 return false; 230 return false;
217 } 231 }
218 232
219 return true; 233 return true;
220 }, 234 },
221 235
222 /** 236 /**
237 * @return {boolean} Whether to show the multidevice settings page.
238 * @private
239 */
240 shouldShowMultidevice_: function() {
241 var visibility = /** @type {boolean|undefined} */ (
242 this.get('pageVisibility.multidevice'));
243 return this.showMultidevice && this.showPage_(visibility);
244 },
245
246 /**
223 * Hides everything but the newly expanded subpage. 247 * Hides everything but the newly expanded subpage.
224 * @private 248 * @private
225 */ 249 */
226 onSubpageExpanded_: function() { 250 onSubpageExpanded_: function() {
227 this.hasExpandedSection_ = true; 251 this.hasExpandedSection_ = true;
228 }, 252 },
229 253
230 /** 254 /**
231 * Render the advanced page now (don't wait for idle). 255 * Render the advanced page now (don't wait for idle).
232 * @private 256 * @private
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 311
288 /** 312 /**
289 * @param {boolean} opened Whether the menu is expanded. 313 * @param {boolean} opened Whether the menu is expanded.
290 * @return {string} Icon name. 314 * @return {string} Icon name.
291 * @private 315 * @private
292 */ 316 */
293 getArrowIcon_: function(opened) { 317 getArrowIcon_: function(opened) {
294 return opened ? 'cr:arrow-drop-up' : 'cr:arrow-drop-down'; 318 return opened ? 'cr:arrow-drop-up' : 'cr:arrow-drop-down';
295 }, 319 },
296 }); 320 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698