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 Polymer({ | 18 Polymer({ |
19 is: 'settings-reset-page', | 19 is: 'settings-reset-page', |
20 | 20 |
21 behaviors: [settings.RouteObserverBehavior], | 21 behaviors: [settings.RouteObserverBehavior], |
22 | 22 |
23 properties: { | 23 properties: { |
24 // <if expr="chromeos"> | 24 // <if expr="chromeos"> |
25 /** @private */ | 25 /** @private */ |
26 showPowerwashDialog_: Boolean, | 26 showPowerwashDialog_: Boolean, |
27 // </if> | 27 // </if> |
28 | 28 |
29 /** @private */ | 29 /** @private */ |
30 allowPowerwash_: { | 30 allowPowerwash_: { |
31 type: Boolean, | 31 type: Boolean, |
32 value: cr.isChromeOS ? loadTimeData.getBoolean('allowPowerwash') : false | 32 value: cr.isChromeOS ? loadTimeData.getBoolean('allowPowerwash') : false |
33 }, | 33 }, |
34 | 34 |
35 /** @private */ | 35 /** @private */ |
36 showResetProfileDialog_: { | 36 showResetProfileDialog_: { |
37 type: Boolean, | 37 type: Boolean, |
38 value: false, | 38 value: false, |
39 }, | 39 }, |
40 }, | 40 }, |
41 | 41 |
42 /** | 42 /** |
43 * settings.RouteObserverBehavior | 43 * settings.RouteObserverBehavior |
44 * @param {!settings.Route} route | 44 * @param {!settings.Route} route |
45 * @protected | 45 * @protected |
46 */ | 46 */ |
47 currentRouteChanged: function(route) { | 47 currentRouteChanged: function(route) { |
48 this.showResetProfileDialog_ = | 48 this.showResetProfileDialog_ = |
49 route == settings.Route.TRIGGERED_RESET_DIALOG || | 49 route == settings.Route.TRIGGERED_RESET_DIALOG || |
50 route == settings.Route.RESET_DIALOG; | 50 route == settings.Route.RESET_DIALOG; |
51 }, | 51 }, |
52 | 52 |
53 /** @private */ | 53 /** @private */ |
54 onShowResetProfileDialog_: function() { | 54 onShowResetProfileDialog_: function() { |
55 settings.navigateTo(settings.Route.RESET_DIALOG, | 55 settings.navigateTo( |
56 new URLSearchParams('origin=userclick')); | 56 settings.Route.RESET_DIALOG, new URLSearchParams('origin=userclick')); |
57 }, | 57 }, |
58 | 58 |
59 /** @private */ | 59 /** @private */ |
60 onResetProfileDialogClose_: function() { | 60 onResetProfileDialogClose_: function() { |
61 settings.navigateToPreviousRoute(); | 61 settings.navigateToPreviousRoute(); |
62 cr.ui.focusWithoutInk(assert(this.$.resetProfileArrow)); | 62 cr.ui.focusWithoutInk(assert(this.$.resetProfileArrow)); |
63 }, | 63 }, |
64 | 64 |
65 // <if expr="chromeos"> | 65 // <if expr="chromeos"> |
66 /** | 66 /** |
67 * @param {!Event} e | 67 * @param {!Event} e |
68 * @private | 68 * @private |
69 */ | 69 */ |
70 onShowPowerwashDialog_: function(e) { | 70 onShowPowerwashDialog_: function(e) { |
71 e.preventDefault(); | 71 e.preventDefault(); |
72 this.showPowerwashDialog_ = true; | 72 this.showPowerwashDialog_ = true; |
73 }, | 73 }, |
74 | 74 |
75 /** @private */ | 75 /** @private */ |
76 onPowerwashDialogClose_: function() { | 76 onPowerwashDialogClose_: function() { |
77 this.showPowerwashDialog_ = false; | 77 this.showPowerwashDialog_ = false; |
78 cr.ui.focusWithoutInk(assert(this.$.powerwashArrow)); | 78 cr.ui.focusWithoutInk(assert(this.$.powerwashArrow)); |
79 }, | 79 }, |
80 // </if> | 80 // </if> |
81 }); | 81 }); |
OLD | NEW |