OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 Loading... | |
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 }); |
OLD | NEW |