| 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-advanced-page' is the settings page containing the advanced | 7 * 'settings-advanced-page' is the settings page containing the advanced |
| 8 * settings. | 8 * settings. |
| 9 * | 9 * |
| 10 * Example: | 10 * Example: |
| 11 * | 11 * |
| 12 * <iron-animated-pages> | 12 * <iron-animated-pages> |
| 13 * <settings-advanced-page prefs="{{prefs}}"> | 13 * <settings-advanced-page prefs="{{prefs}}"> |
| 14 * </settings-advanced-page> | 14 * </settings-advanced-page> |
| 15 * ... other pages ... | 15 * ... other pages ... |
| 16 * </iron-animated-pages> | 16 * </iron-animated-pages> |
| 17 */ | 17 */ |
| 18 Polymer({ | 18 Polymer({ |
| 19 is: 'settings-advanced-page', | 19 is: 'settings-advanced-page', |
| 20 | 20 |
| 21 behaviors: [I18nBehavior, SettingsPageVisibility, RoutableBehavior], |
| 22 |
| 21 properties: { | 23 properties: { |
| 22 /** | 24 /** |
| 23 * Preferences state. | 25 * Preferences state. |
| 24 */ | 26 */ |
| 25 prefs: { | 27 prefs: { |
| 26 type: Object, | 28 type: Object, |
| 27 notify: true, | 29 notify: true, |
| 28 }, | 30 }, |
| 29 | 31 |
| 30 /** | 32 /** |
| 31 * The current active route. | 33 * The current active route. |
| 32 */ | 34 */ |
| 33 currentRoute: { | 35 currentRoute: { |
| 34 type: Object, | 36 type: Object, |
| 35 notify: true, | 37 notify: true, |
| 36 }, | 38 }, |
| 37 }, | 39 }, |
| 38 | 40 |
| 41 /** |
| 42 * @type {string} Selector to get the sections. |
| 43 * TODO(michaelpg): replace duplicate docs with @override once b/24294625 |
| 44 * is fixed. |
| 45 */ |
| 46 sectionSelector: 'settings-section', |
| 47 |
| 39 <if expr="not chromeos"> | 48 <if expr="not chromeos"> |
| 40 listeners: { | 49 listeners: { |
| 41 'dom-change': 'onDomChange_', | 50 'dom-change': 'onDomChange_', |
| 42 }, | 51 }, |
| 52 </if> |
| 43 | 53 |
| 54 /** @override */ |
| 55 attached: function() { |
| 56 /** @override */ |
| 57 this.scroller = this.parentElement; |
| 58 }, |
| 59 |
| 60 <if expr="not chromeos"> |
| 44 /** @private */ | 61 /** @private */ |
| 45 onDomChange_: function() { | 62 onDomChange_: function() { |
| 46 var systemPage = /** @type {?SettingsSystemPageElement} */( | 63 var systemPage = /** @type {?SettingsSystemPageElement} */( |
| 47 this.$$('settings-system-page')); | 64 this.$$('settings-system-page')); |
| 48 if (systemPage && !systemPage.delegate) | 65 if (systemPage && !systemPage.delegate) |
| 49 systemPage.delegate = new settings.SystemPageDelegateImpl; | 66 systemPage.delegate = new settings.SystemPageDelegateImpl; |
| 50 }, | 67 }, |
| 51 </if> | 68 </if> |
| 52 | |
| 53 behaviors: [I18nBehavior, SettingsPageVisibility], | |
| 54 }); | 69 }); |
| OLD | NEW |