| 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 OptionsPage = options.OptionsPage; |
| 7 | 7 |
| 8 var AutomaticSettingsResetBanner = options.AutomaticSettingsResetBanner; | 8 var AutomaticSettingsResetBanner = options.AutomaticSettingsResetBanner; |
| 9 var ResetProfileSettingsBanner = options.ResetProfileSettingsBanner; | |
| 10 | 9 |
| 11 /** | 10 /** |
| 12 * ResetProfileSettingsOverlay class | 11 * ResetProfileSettingsOverlay class |
| 13 * Encapsulated handling of the 'Reset Profile Settings' overlay page. | 12 * Encapsulated handling of the 'Reset Profile Settings' overlay page. |
| 14 * @class | 13 * @class |
| 15 */ | 14 */ |
| 16 function ResetProfileSettingsOverlay() { | 15 function ResetProfileSettingsOverlay() { |
| 17 OptionsPage.call( | 16 OptionsPage.call( |
| 18 this, 'resetProfileSettings', | 17 this, 'resetProfileSettings', |
| 19 loadTimeData.getString('resetProfileSettingsOverlayTabTitle'), | 18 loadTimeData.getString('resetProfileSettingsOverlayTabTitle'), |
| (...skipping 19 matching lines...) Expand all Loading... |
| 39 [$('send-settings').checked]); | 38 [$('send-settings').checked]); |
| 40 }; | 39 }; |
| 41 $('expand-feedback').onclick = function(event) { | 40 $('expand-feedback').onclick = function(event) { |
| 42 var feedbackTemplate = $('feedback-template'); | 41 var feedbackTemplate = $('feedback-template'); |
| 43 feedbackTemplate.hidden = !feedbackTemplate.hidden; | 42 feedbackTemplate.hidden = !feedbackTemplate.hidden; |
| 44 }; | 43 }; |
| 45 }, | 44 }, |
| 46 | 45 |
| 47 /** @override */ | 46 /** @override */ |
| 48 didShowPage: function() { | 47 didShowPage: function() { |
| 49 ResetProfileSettingsBanner.dismiss(); | |
| 50 chrome.send('onShowResetProfileDialog'); | 48 chrome.send('onShowResetProfileDialog'); |
| 51 }, | 49 }, |
| 52 | 50 |
| 53 /** @override */ | 51 /** @override */ |
| 54 didClosePage: function() { | 52 didClosePage: function() { |
| 55 chrome.send('onHideResetProfileDialog'); | 53 chrome.send('onHideResetProfileDialog'); |
| 56 }, | 54 }, |
| 57 }; | 55 }; |
| 58 | 56 |
| 59 /** | 57 /** |
| 60 * Enables/disables UI elements after/while Chrome is performing a reset. | 58 * Enables/disables UI elements after/while Chrome is performing a reset. |
| 61 * @param {boolean} state If true, UI elements are disabled. | 59 * @param {boolean} state If true, UI elements are disabled. |
| 62 */ | 60 */ |
| 63 ResetProfileSettingsOverlay.setResettingState = function(state) { | 61 ResetProfileSettingsOverlay.setResettingState = function(state) { |
| 64 $('reset-profile-settings-throbber').style.visibility = | 62 $('reset-profile-settings-throbber').style.visibility = |
| 65 state ? 'visible' : 'hidden'; | 63 state ? 'visible' : 'hidden'; |
| 66 $('reset-profile-settings-dismiss').disabled = state; | 64 $('reset-profile-settings-dismiss').disabled = state; |
| 67 $('reset-profile-settings-commit').disabled = state; | 65 $('reset-profile-settings-commit').disabled = state; |
| 68 }; | 66 }; |
| 69 | 67 |
| 70 /** | 68 /** |
| 71 * Chrome callback to notify ResetProfileSettingsOverlay that the reset | 69 * Chrome callback to notify ResetProfileSettingsOverlay that the reset |
| 72 * operation has terminated. | 70 * operation has terminated. |
| 73 */ | 71 */ |
| 74 ResetProfileSettingsOverlay.doneResetting = function() { | 72 ResetProfileSettingsOverlay.doneResetting = function() { |
| 75 AutomaticSettingsResetBanner.dismiss(); | |
| 76 ResetProfileSettingsOverlay.dismiss(); | 73 ResetProfileSettingsOverlay.dismiss(); |
| 77 }; | 74 }; |
| 78 | 75 |
| 79 /** | 76 /** |
| 80 * Dismisses the overlay. | 77 * Dismisses the overlay. |
| 81 */ | 78 */ |
| 82 ResetProfileSettingsOverlay.dismiss = function() { | 79 ResetProfileSettingsOverlay.dismiss = function() { |
| 83 OptionsPage.closeOverlay(); | 80 OptionsPage.closeOverlay(); |
| 84 ResetProfileSettingsOverlay.setResettingState(false); | 81 ResetProfileSettingsOverlay.setResettingState(false); |
| 85 }; | 82 }; |
| 86 | 83 |
| 87 ResetProfileSettingsOverlay.setFeedbackInfo = function(feedbackListData) { | 84 ResetProfileSettingsOverlay.setFeedbackInfo = function(feedbackListData) { |
| 88 var input = new JsEvalContext(feedbackListData); | 85 var input = new JsEvalContext(feedbackListData); |
| 89 var output = $('feedback-template'); | 86 var output = $('feedback-template'); |
| 90 jstProcess(input, output); | 87 jstProcess(input, output); |
| 91 }; | 88 }; |
| 92 | 89 |
| 93 // Export | 90 // Export |
| 94 return { | 91 return { |
| 95 ResetProfileSettingsOverlay: ResetProfileSettingsOverlay | 92 ResetProfileSettingsOverlay: ResetProfileSettingsOverlay |
| 96 }; | 93 }; |
| 97 }); | 94 }); |
| OLD | NEW |