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 this.async(function() { | |
39 this.$.resetDialog.center(); | |
40 }); | |
41 }.bind(this), | |
42 }; | |
43 }.bind(this)); | |
44 }, | |
45 | |
24 /** @private */ | 46 /** @private */ |
25 onShowDialog_: function() { | 47 onShowDialog_: function() { |
26 this.$.resetDialog.open(); | 48 this.$.resetDialog.open(); |
49 chrome.send('onShowResetProfileDialog'); | |
27 }, | 50 }, |
28 | 51 |
29 /** @private */ | 52 /** @private */ |
30 onCancelTap_: function() { | 53 onCancelTap_: function() { |
31 this.$.resetDialog.close(); | 54 this.$.resetDialog.close(); |
55 chrome.send('onHideResetProfileDialog'); | |
32 }, | 56 }, |
33 | 57 |
34 /** @private */ | 58 /** @private */ |
35 onResetTap_: function() { | 59 onResetTap_: function() { |
36 // TODO(dpapad): Set up C++ handlers and figure out when it is OK to close | 60 this.$.resetSpinner.active = true; |
37 // the dialog. | 61 chrome.send('performResetProfileSettings', [this.$.sendSettings.checked]); |
38 this.$.resetDialog.close(); | |
39 }, | 62 }, |
40 | 63 |
41 /** @private */ | 64 /** @private */ |
42 onLearnMoreTap_: function() { | 65 onLearnMoreTap_: function() { |
43 window.open(loadTimeData.getString('resetPageLearnMoreUrl')); | 66 window.open(loadTimeData.getString('resetPageLearnMoreUrl')); |
67 }, | |
68 | |
69 /** @private */ | |
70 onCheckboxChange_: function() { | |
Dan Beam
2015/11/07 03:19:26
TODO(dpapad): find out what should actually show t
dpapad
2015/11/09 18:51:10
Done. Added TODO.
| |
71 this.$.settings.hidden = !this.$.sendSettings.checked; | |
72 this.$.resetDialog.center(); | |
44 } | 73 } |
45 }); | 74 }); |
OLD | NEW |