OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 cr.define('options', function() { | 5 cr.define('options', function() { |
6 var OptionsPage = options.OptionsPage; | 6 var Page = cr.ui.pageManager.Page; |
7 | 7 |
8 var AutomaticSettingsResetBanner = options.AutomaticSettingsResetBanner; | 8 var AutomaticSettingsResetBanner = options.AutomaticSettingsResetBanner; |
9 var ResetProfileSettingsBanner = options.ResetProfileSettingsBanner; | 9 var ResetProfileSettingsBanner = options.ResetProfileSettingsBanner; |
10 | 10 |
11 /** | 11 /** |
12 * ResetProfileSettingsOverlay class | 12 * ResetProfileSettingsOverlay class |
13 * Encapsulated handling of the 'Reset Profile Settings' overlay page. | 13 * Encapsulated handling of the 'Reset Profile Settings' overlay page. |
14 * @class | 14 * @class |
15 */ | 15 */ |
16 function ResetProfileSettingsOverlay() { | 16 function ResetProfileSettingsOverlay() { |
17 OptionsPage.call( | 17 Page.call(this, 'resetProfileSettings', |
18 this, 'resetProfileSettings', | 18 loadTimeData.getString('resetProfileSettingsOverlayTabTitle'), |
19 loadTimeData.getString('resetProfileSettingsOverlayTabTitle'), | 19 'reset-profile-settings-overlay'); |
20 'reset-profile-settings-overlay'); | |
21 } | 20 } |
22 | 21 |
23 cr.addSingletonGetter(ResetProfileSettingsOverlay); | 22 cr.addSingletonGetter(ResetProfileSettingsOverlay); |
24 | 23 |
25 ResetProfileSettingsOverlay.prototype = { | 24 ResetProfileSettingsOverlay.prototype = { |
26 // Inherit ResetProfileSettingsOverlay from OptionsPage. | 25 // Inherit ResetProfileSettingsOverlay from Page. |
27 __proto__: OptionsPage.prototype, | 26 __proto__: Page.prototype, |
28 | 27 |
29 /** @override */ | 28 /** @override */ |
30 initializePage: function() { | 29 initializePage: function() { |
31 OptionsPage.prototype.initializePage.call(this); | 30 Page.prototype.initializePage.call(this); |
32 | 31 |
33 $('reset-profile-settings-dismiss').onclick = function(event) { | 32 $('reset-profile-settings-dismiss').onclick = function(event) { |
34 ResetProfileSettingsOverlay.dismiss(); | 33 ResetProfileSettingsOverlay.dismiss(); |
35 }; | 34 }; |
36 $('reset-profile-settings-commit').onclick = function(event) { | 35 $('reset-profile-settings-commit').onclick = function(event) { |
37 ResetProfileSettingsOverlay.setResettingState(true); | 36 ResetProfileSettingsOverlay.setResettingState(true); |
38 chrome.send('performResetProfileSettings', | 37 chrome.send('performResetProfileSettings', |
39 [$('send-settings').checked]); | 38 [$('send-settings').checked]); |
40 }; | 39 }; |
41 $('expand-feedback').onclick = function(event) { | 40 $('expand-feedback').onclick = function(event) { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 */ | 72 */ |
74 ResetProfileSettingsOverlay.doneResetting = function() { | 73 ResetProfileSettingsOverlay.doneResetting = function() { |
75 AutomaticSettingsResetBanner.dismiss(); | 74 AutomaticSettingsResetBanner.dismiss(); |
76 ResetProfileSettingsOverlay.dismiss(); | 75 ResetProfileSettingsOverlay.dismiss(); |
77 }; | 76 }; |
78 | 77 |
79 /** | 78 /** |
80 * Dismisses the overlay. | 79 * Dismisses the overlay. |
81 */ | 80 */ |
82 ResetProfileSettingsOverlay.dismiss = function() { | 81 ResetProfileSettingsOverlay.dismiss = function() { |
83 OptionsPage.closeOverlay(); | 82 PageManager.closeOverlay(); |
84 ResetProfileSettingsOverlay.setResettingState(false); | 83 ResetProfileSettingsOverlay.setResettingState(false); |
85 }; | 84 }; |
86 | 85 |
87 ResetProfileSettingsOverlay.setFeedbackInfo = function(feedbackListData) { | 86 ResetProfileSettingsOverlay.setFeedbackInfo = function(feedbackListData) { |
88 var input = new JsEvalContext(feedbackListData); | 87 var input = new JsEvalContext(feedbackListData); |
89 var output = $('feedback-template'); | 88 var output = $('feedback-template'); |
90 jstProcess(input, output); | 89 jstProcess(input, output); |
91 }; | 90 }; |
92 | 91 |
93 // Export | 92 // Export |
94 return { | 93 return { |
95 ResetProfileSettingsOverlay: ResetProfileSettingsOverlay | 94 ResetProfileSettingsOverlay: ResetProfileSettingsOverlay |
96 }; | 95 }; |
97 }); | 96 }); |
OLD | NEW |