| 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 properties: { |
| 25 feedbackInfo: String, |
| 26 }, |
| 27 |
| 28 attached: function() { |
| 29 cr.define('SettingsResetPage', function() { |
| 30 return { |
| 31 doneResetting: function() { |
| 32 this.$.resetSpinner.active = false; |
| 33 this.$.resetDialog.close(); |
| 34 }.bind(this), |
| 35 |
| 36 setFeedbackInfo: function(data) { |
| 37 this.set('feedbackInfo', data.feedbackInfo); |
| 38 }.bind(this), |
| 39 }; |
| 40 }.bind(this)); |
| 41 }, |
| 42 |
| 24 /** @private */ | 43 /** @private */ |
| 25 onShowDialog_: function() { | 44 onShowDialog_: function() { |
| 26 this.$.resetDialog.open(); | 45 this.$.resetDialog.open(); |
| 46 chrome.send('onShowResetProfileDialog'); |
| 27 }, | 47 }, |
| 28 | 48 |
| 29 /** @private */ | 49 /** @private */ |
| 30 onCancelTap_: function() { | 50 onCancelTap_: function() { |
| 31 this.$.resetDialog.close(); | 51 this.$.resetDialog.close(); |
| 52 chrome.send('onHideResetProfileDialog'); |
| 32 }, | 53 }, |
| 33 | 54 |
| 34 /** @private */ | 55 /** @private */ |
| 35 onResetTap_: function() { | 56 onResetTap_: function() { |
| 36 // TODO(dpapad): Set up C++ handlers and figure out when it is OK to close | 57 this.$.resetSpinner.active = true; |
| 37 // the dialog. | 58 chrome.send('performResetProfileSettings', [this.$.sendSettings.checked]); |
| 38 this.$.resetDialog.close(); | |
| 39 }, | 59 }, |
| 40 | 60 |
| 41 /** @private */ | 61 /** @private */ |
| 42 onLearnMoreTap_: function() { | 62 onLearnMoreTap_: function() { |
| 43 window.open(loadTimeData.getString('resetPageLearnMoreUrl')); | 63 window.open(loadTimeData.getString('resetPageLearnMoreUrl')); |
| 64 }, |
| 65 |
| 66 /** @private */ |
| 67 onCheckboxChange_: function() { |
| 68 this.$.sendSettings.checked ? |
| 69 this.$.settings.removeAttribute('hidden') : |
| 70 this.$.settings.setAttribute('hidden', true); |
| 44 } | 71 } |
| 45 }); | 72 }); |
| OLD | NEW |