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