OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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('extensions', function() { | 5 cr.define('extensions', function() { |
6 /** | 6 /** |
7 * PackExtensionOverlay class | 7 * PackExtensionOverlay class |
8 * Encapsulated handling of the 'Pack Extension' overlay page. | 8 * Encapsulated handling of the 'Pack Extension' overlay page. |
9 * @constructor | 9 * @constructor |
10 */ | 10 */ |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 }, | 90 }, |
91 }; | 91 }; |
92 | 92 |
93 /** | 93 /** |
94 * Wrap up the pack process by showing the success |message| and closing | 94 * Wrap up the pack process by showing the success |message| and closing |
95 * the overlay. | 95 * the overlay. |
96 * @param {String} message The message to show to the user. | 96 * @param {String} message The message to show to the user. |
97 */ | 97 */ |
98 PackExtensionOverlay.showSuccessMessage = function(message) { | 98 PackExtensionOverlay.showSuccessMessage = function(message) { |
99 alertOverlay.setValues( | 99 alertOverlay.setValues( |
100 localStrings.getString('packExtensionOverlay'), | 100 loadTimeData.getString('packExtensionOverlay'), |
101 message, | 101 message, |
102 localStrings.getString('ok'), | 102 loadTimeData.getString('ok'), |
103 '', | 103 '', |
104 function() { | 104 function() { |
105 ExtensionSettings.showOverlay(null); | 105 ExtensionSettings.showOverlay(null); |
106 }, | 106 }, |
107 null); | 107 null); |
108 ExtensionSettings.showOverlay($('alertOverlay')); | 108 ExtensionSettings.showOverlay($('alertOverlay')); |
109 }; | 109 }; |
110 | 110 |
111 /** | 111 /** |
112 * Post an alert overlay showing |message|, and upon acknowledgement, close | 112 * Post an alert overlay showing |message|, and upon acknowledgement, close |
113 * the alert overlay and return to showing the PackExtensionOverlay. | 113 * the alert overlay and return to showing the PackExtensionOverlay. |
114 */ | 114 */ |
115 PackExtensionOverlay.showError = function(message) { | 115 PackExtensionOverlay.showError = function(message) { |
116 alertOverlay.setValues( | 116 alertOverlay.setValues( |
117 localStrings.getString('packExtensionErrorTitle'), | 117 loadTimeData.getString('packExtensionErrorTitle'), |
118 message, | 118 message, |
119 localStrings.getString('ok'), | 119 loadTimeData.getString('ok'), |
120 '', | 120 '', |
121 function() { | 121 function() { |
122 ExtensionSettings.showOverlay($('packExtensionOverlay')); | 122 ExtensionSettings.showOverlay($('packExtensionOverlay')); |
123 }, | 123 }, |
124 null); | 124 null); |
125 ExtensionSettings.showOverlay($('alertOverlay')); | 125 ExtensionSettings.showOverlay($('alertOverlay')); |
126 }; | 126 }; |
127 | 127 |
128 // Export | 128 // Export |
129 return { | 129 return { |
130 PackExtensionOverlay: PackExtensionOverlay | 130 PackExtensionOverlay: PackExtensionOverlay |
131 }; | 131 }; |
132 }); | 132 }); |
133 | 133 |
134 // Update the C++ call so this isn't necessary. | 134 // Update the C++ call so this isn't necessary. |
135 var PackExtensionOverlay = extensions.PackExtensionOverlay; | 135 var PackExtensionOverlay = extensions.PackExtensionOverlay; |
OLD | NEW |