Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(360)

Side by Side Diff: chrome/browser/resources/extensions/pack_extension_overlay.js

Issue 512003002: Revert of Revert "Typecheck JS files for chrome://extensions" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 /** 54 /**
55 * Utility function which asks the C++ to show a platform-specific file 55 * Utility function which asks the C++ to show a platform-specific file
56 * select dialog, and fire |callback| with the |filePath| that resulted. 56 * select dialog, and fire |callback| with the |filePath| that resulted.
57 * |selectType| can be either 'file' or 'folder'. |operation| can be 'load' 57 * |selectType| can be either 'file' or 'folder'. |operation| can be 'load'
58 * or 'pem' which are signals to the C++ to do some operation-specific 58 * or 'pem' which are signals to the C++ to do some operation-specific
59 * configuration. 59 * configuration.
60 * @private 60 * @private
61 */ 61 */
62 showFileDialog_: function(selectType, operation, callback) { 62 showFileDialog_: function(selectType, operation, callback) {
63 handleFilePathSelected = function(filePath) { 63 window.handleFilePathSelected = function(filePath) {
64 callback(filePath); 64 callback(filePath);
65 handleFilePathSelected = function() {}; 65 window.handleFilePathSelected = function() {};
66 }; 66 };
67 67
68 chrome.send('packExtensionSelectFilePath', [selectType, operation]); 68 chrome.send('packExtensionSelectFilePath', [selectType, operation]);
69 }, 69 },
70 70
71 /** 71 /**
72 * Handles the showing of the extension directory browser. 72 * Handles the showing of the extension directory browser.
73 * @param {Event} e Change event. 73 * @param {Event} e Change event.
74 * @private 74 * @private
75 */ 75 */
(...skipping 21 matching lines...) Expand all
97 * @param {string} message The message to show to the user. 97 * @param {string} message The message to show to the user.
98 */ 98 */
99 PackExtensionOverlay.showSuccessMessage = function(message) { 99 PackExtensionOverlay.showSuccessMessage = function(message) {
100 alertOverlay.setValues( 100 alertOverlay.setValues(
101 loadTimeData.getString('packExtensionOverlay'), 101 loadTimeData.getString('packExtensionOverlay'),
102 message, 102 message,
103 loadTimeData.getString('ok'), 103 loadTimeData.getString('ok'),
104 '', 104 '',
105 function() { 105 function() {
106 extensions.ExtensionSettings.showOverlay(null); 106 extensions.ExtensionSettings.showOverlay(null);
107 }, 107 });
108 null);
109 extensions.ExtensionSettings.showOverlay($('alertOverlay')); 108 extensions.ExtensionSettings.showOverlay($('alertOverlay'));
110 }; 109 };
111 110
112 /** 111 /**
113 * Post an alert overlay showing |message|, and upon acknowledgement, close 112 * Post an alert overlay showing |message|, and upon acknowledgement, close
114 * the alert overlay and return to showing the PackExtensionOverlay. 113 * the alert overlay and return to showing the PackExtensionOverlay.
114 * @param {string} message The error message.
115 */ 115 */
116 PackExtensionOverlay.showError = function(message) { 116 PackExtensionOverlay.showError = function(message) {
117 alertOverlay.setValues( 117 alertOverlay.setValues(
118 loadTimeData.getString('packExtensionErrorTitle'), 118 loadTimeData.getString('packExtensionErrorTitle'),
119 message, 119 message,
120 loadTimeData.getString('ok'), 120 loadTimeData.getString('ok'),
121 '', 121 '',
122 function() { 122 function() {
123 extensions.ExtensionSettings.showOverlay($('pack-extension-overlay')); 123 extensions.ExtensionSettings.showOverlay($('pack-extension-overlay'));
124 }, 124 });
125 null);
126 extensions.ExtensionSettings.showOverlay($('alertOverlay')); 125 extensions.ExtensionSettings.showOverlay($('alertOverlay'));
127 }; 126 };
128 127
129 // Export 128 // Export
130 return { 129 return {
131 PackExtensionOverlay: PackExtensionOverlay 130 PackExtensionOverlay: PackExtensionOverlay
132 }; 131 };
133 }); 132 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/extensions/extensions.js ('k') | chrome/browser/ui/webui/extensions/chromeos/kiosk_apps_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698