| 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-dialog' is the dialog shown for clearing profile | 7 * 'settings-reset-profile-dialog' is the dialog shown for clearing profile |
| 8 * settings. | 8 * settings. |
| 9 */ | 9 */ |
| 10 Polymer({ | 10 Polymer({ |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 /** @override */ | 28 /** @override */ |
| 29 ready: function() { | 29 ready: function() { |
| 30 this.browserProxy_ = settings.ResetBrowserProxyImpl.getInstance(); | 30 this.browserProxy_ = settings.ResetBrowserProxyImpl.getInstance(); |
| 31 | 31 |
| 32 this.addEventListener('cancel', function() { | 32 this.addEventListener('cancel', function() { |
| 33 this.browserProxy_.onHideResetProfileDialog(); | 33 this.browserProxy_.onHideResetProfileDialog(); |
| 34 }.bind(this)); | 34 }.bind(this)); |
| 35 }, | 35 }, |
| 36 | 36 |
| 37 open: function() { | 37 /** @override */ |
| 38 attached: function() { |
| 38 this.$.dialog.showModal(); | 39 this.$.dialog.showModal(); |
| 39 this.browserProxy_.onShowResetProfileDialog(); | 40 this.browserProxy_.onShowResetProfileDialog(); |
| 40 }, | 41 }, |
| 41 | 42 |
| 42 /** @private */ | 43 /** @private */ |
| 43 onCancelTap_: function() { | 44 onCancelTap_: function() { |
| 44 this.$.dialog.cancel(); | 45 this.$.dialog.cancel(); |
| 45 }, | 46 }, |
| 46 | 47 |
| 47 /** @private */ | 48 /** @private */ |
| 48 onResetTap_: function() { | 49 onResetTap_: function() { |
| 49 this.clearingInProgress_ = true; | 50 this.clearingInProgress_ = true; |
| 50 this.browserProxy_.performResetProfileSettings( | 51 this.browserProxy_.performResetProfileSettings( |
| 51 this.$.sendSettings.checked).then(function() { | 52 this.$.sendSettings.checked).then(function() { |
| 52 this.clearingInProgress_ = false; | 53 this.clearingInProgress_ = false; |
| 53 if (this.$.dialog.open) | 54 if (this.$.dialog.open) |
| 54 this.$.dialog.close(); | 55 this.$.dialog.close(); |
| 55 this.fire('reset-done'); | 56 this.fire('reset-done'); |
| 56 }.bind(this)); | 57 }.bind(this)); |
| 57 }, | 58 }, |
| 58 | 59 |
| 59 /** | 60 /** |
| 60 * Displays the settings that will be reported in a new tab. | 61 * Displays the settings that will be reported in a new tab. |
| 61 * @private | 62 * @private |
| 62 */ | 63 */ |
| 63 onShowReportedSettingsTap_: function() { | 64 onShowReportedSettingsTap_: function() { |
| 64 this.browserProxy_.showReportedSettings(); | 65 this.browserProxy_.showReportedSettings(); |
| 65 }, | 66 }, |
| 66 }); | 67 }); |
| OLD | NEW |