| 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-reset-page' is the settings page containing reset | 7 * 'settings-reset-page' is the settings page containing reset |
| 8 * settings. | 8 * settings. |
| 9 * | 9 * |
| 10 * Example: | 10 * Example: |
| 11 * | 11 * |
| 12 * <iron-animated-pages> | 12 * <iron-animated-pages> |
| 13 * <settings-reset-page prefs="{{prefs}}"> | 13 * <settings-reset-page prefs="{{prefs}}"> |
| 14 * </settings-reset-page> | 14 * </settings-reset-page> |
| 15 * ... other pages ... | 15 * ... other pages ... |
| 16 * </iron-animated-pages> | 16 * </iron-animated-pages> |
| 17 * | 17 * |
| 18 * @group Chrome Settings Elements | 18 * @group Chrome Settings Elements |
| 19 * @element settings-reset-page | 19 * @element settings-reset-page |
| 20 */ | 20 */ |
| 21 Polymer({ | 21 Polymer({ |
| 22 is: 'settings-reset-page', | 22 is: 'settings-reset-page', |
| 23 | 23 |
| 24 | 24 |
| 25 /** @private */ | 25 /** @private */ |
| 26 onShowDialog_: function() { | 26 onShowResetProfileDialog_: function() { |
| 27 var dialog = document.createElement('settings-reset-profile-dialog'); | 27 this.showDialog_('settings-reset-profile-dialog'); |
| 28 }, |
| 29 |
| 30 /** @private */ |
| 31 onShowPowerwashDialog_: function() { |
| 32 this.showDialog_('settings-powerwash-dialog'); |
| 33 }, |
| 34 |
| 35 |
| 36 /** |
| 37 * Creates and shows the specified dialog. |
| 38 * @param {string} dialogName |
| 39 * @private |
| 40 */ |
| 41 showDialog_: function(dialogName) { |
| 42 var dialog = document.createElement(dialogName); |
| 28 this.shadowRoot.appendChild(dialog); | 43 this.shadowRoot.appendChild(dialog); |
| 29 dialog.open(); | 44 dialog.open(); |
| 30 | 45 |
| 31 dialog.addEventListener('iron-overlay-closed', function(event) { | 46 dialog.addEventListener('iron-overlay-closed', function(event) { |
| 32 dialog.remove(); | 47 dialog.remove(); |
| 33 }); | 48 }); |
| 34 }, | 49 }, |
| 35 }); | 50 }); |
| OLD | NEW |