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

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

Issue 9703039: Extensions: Don't pass the selected unpacked extension path from JS to C++ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/resources/extensions/pack_extension_overlay.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <include src="../uber/uber_utils.js"></include> 5 <include src="../uber/uber_utils.js"></include>
6 <include src="extension_list.js"></include> 6 <include src="extension_list.js"></include>
7 <include src="pack_extension_overlay.js"></include> 7 <include src="pack_extension_overlay.js"></include>
8 8
9 // Used for observing function of the backend datasource for this page by 9 // Used for observing function of the backend datasource for this page by
10 // tests. 10 // tests.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 var packExtensionOverlay = extensions.PackExtensionOverlay.getInstance(); 61 var packExtensionOverlay = extensions.PackExtensionOverlay.getInstance();
62 packExtensionOverlay.initializePage(); 62 packExtensionOverlay.initializePage();
63 63
64 // Trigger the scroll handler to tell the navigation if our page started 64 // Trigger the scroll handler to tell the navigation if our page started
65 // with some scroll (happens when you use tab restore). 65 // with some scroll (happens when you use tab restore).
66 this.handleScroll_(); 66 this.handleScroll_();
67 }, 67 },
68 68
69 /** 69 /**
70 * Utility function which asks the C++ to show a platform-specific file
71 * select dialog, and fire |callback| with the |filePath| that resulted.
72 * |selectType| can be either 'file' or 'folder'. |operation| can be 'load',
73 * 'packRoot', or 'pem' which are signals to the C++ to do some
74 * operation-specific configuration.
75 * @private
76 */
77 showFileDialog_: function(selectType, operation, callback) {
78 handleFilePathSelected = function(filePath) {
79 callback(filePath);
80 handleFilePathSelected = function() {};
81 };
82
83 chrome.send('extensionSettingsSelectFilePath', [selectType, operation]);
84 },
85
86 /**
87 * Handles the Load Unpacked Extension button. 70 * Handles the Load Unpacked Extension button.
88 * @param {Event} e Change event. 71 * @param {Event} e Change event.
89 * @private 72 * @private
90 */ 73 */
91 handleLoadUnpackedExtension_: function(e) { 74 handleLoadUnpackedExtension_: function(e) {
92 this.showFileDialog_('folder', 'pem', function(filePath) { 75 chrome.send('extensionSettingsLoadUnpackedExtension');
93 chrome.send('extensionSettingsLoad', [String(filePath)]);
94 });
95 76
77 // TODO(jhawkins): Refactor metrics support out of options and use it
78 // in extensions.html.
96 chrome.send('coreOptionsUserMetricsAction', 79 chrome.send('coreOptionsUserMetricsAction',
97 ['Options_LoadUnpackedExtension']); 80 ['Options_LoadUnpackedExtension']);
98 }, 81 },
99 82
100 /** 83 /**
101 * Handles the Pack Extension button. 84 * Handles the Pack Extension button.
102 * @param {Event} e Change event. 85 * @param {Event} e Change event.
103 * @private 86 * @private
104 */ 87 */
105 handlePackExtension_: function(e) { 88 handlePackExtension_: function(e) {
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 ExtensionSettings: ExtensionSettings 231 ExtensionSettings: ExtensionSettings
249 }; 232 };
250 }); 233 });
251 234
252 var ExtensionSettings = extensions.ExtensionSettings; 235 var ExtensionSettings = extensions.ExtensionSettings;
253 236
254 // 'load' seems to have a bad interaction with open_sans.woff. 237 // 'load' seems to have a bad interaction with open_sans.woff.
255 window.addEventListener('DOMContentLoaded', function(e) { 238 window.addEventListener('DOMContentLoaded', function(e) {
256 ExtensionSettings.getInstance().initialize(); 239 ExtensionSettings.getInstance().initialize();
257 }); 240 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/extensions/pack_extension_overlay.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698