| 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-profile-banner' is the banner shown for clearing profile | 7 * 'settings-reset-profile-banner' is the banner shown for propmting the user to |
| 8 * settings. | 8 * clear profile settings. |
| 9 */ | 9 */ |
| 10 Polymer({ | 10 Polymer({ |
| 11 // TODO(dpapad): Rename to settings-reset-warning-dialog. |
| 11 is: 'settings-reset-profile-banner', | 12 is: 'settings-reset-profile-banner', |
| 12 | 13 |
| 13 properties: { | 14 listeners: { |
| 14 showResetProfileDialog_: { | 15 'cancel': 'onCancel_', |
| 15 type: Boolean, | 16 }, |
| 16 value: false, | 17 |
| 17 }, | 18 /** @override */ |
| 19 attached: function() { |
| 20 this.$.dialog.showModal(); |
| 18 }, | 21 }, |
| 19 | 22 |
| 20 /** @private */ | 23 /** @private */ |
| 21 onCloseTap_: function() { | 24 onOkTap_: function() { |
| 22 settings.ResetBrowserProxyImpl.getInstance().onHideResetProfileBanner(); | 25 this.$.dialog.cancel(); |
| 23 this.remove(); | |
| 24 }, | |
| 25 | |
| 26 /** | |
| 27 * Shows a <settings-reset-profile-dialog>. | |
| 28 * @param {!Event} e | |
| 29 * @private | |
| 30 */ | |
| 31 showDialog_: function(e) { | |
| 32 e.preventDefault(); | |
| 33 this.showResetProfileDialog_ = true; | |
| 34 }, | 26 }, |
| 35 | 27 |
| 36 /** @private */ | 28 /** @private */ |
| 37 onDialogClose_: function() { | 29 onCancel_: function() { |
| 38 this.showResetProfileDialog_ = false; | 30 settings.ResetBrowserProxyImpl.getInstance().onHideResetProfileBanner(); |
| 31 }, |
| 32 |
| 33 /** @private */ |
| 34 onResetTap_: function() { |
| 35 this.$.dialog.close(); |
| 36 settings.navigateTo(settings.Route.RESET_DIALOG); |
| 39 }, | 37 }, |
| 40 }); | 38 }); |
| OLD | NEW |