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 is: 'settings-reset-profile-banner', | 11 is: 'settings-reset-profile-banner', |
12 | 12 |
13 properties: { | 13 listeners: { |
14 showResetProfileDialog_: { | 14 'cancel': 'onCancel_', |
15 type: Boolean, | 15 }, |
16 value: false, | 16 |
17 }, | 17 /** @override */ |
| 18 attached: function() { |
| 19 this.$.dialog.showModal(); |
18 }, | 20 }, |
19 | 21 |
20 /** @private */ | 22 /** @private */ |
21 onCloseTap_: function() { | 23 onOkTap_: function() { |
22 settings.ResetBrowserProxyImpl.getInstance().onHideResetProfileBanner(); | 24 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 }, | 25 }, |
35 | 26 |
36 /** @private */ | 27 /** @private */ |
37 onDialogClose_: function() { | 28 onCancel_: function() { |
38 this.showResetProfileDialog_ = false; | 29 settings.ResetBrowserProxyImpl.getInstance().onHideResetProfileBanner(); |
| 30 }, |
| 31 |
| 32 /** @private */ |
| 33 onResetTap_: function() { |
| 34 this.$.dialog.close(); |
| 35 settings.navigateTo(settings.Route.RESET_DIALOG); |
39 }, | 36 }, |
40 }); | 37 }); |
OLD | NEW |