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

Side by Side Diff: chrome/browser/resources/options/pack_extension_overlay.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: Review fixes. 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
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('options', function() { 5 cr.define('options', function() {
6 const OptionsPage = options.OptionsPage; 6 const OptionsPage = options.OptionsPage;
7 7
8 /** 8 /**
9 * PackExtensionOverlay class 9 * PackExtensionOverlay class
10 * Encapsulated handling of the 'Pack Extension' overlay page. 10 * Encapsulated handling of the 'Pack Extension' overlay page.
(...skipping 29 matching lines...) Expand all
40 $('browseExtensionDir').addEventListener('click', 40 $('browseExtensionDir').addEventListener('click',
41 this.handleBrowseExtensionDir_.bind(this)); 41 this.handleBrowseExtensionDir_.bind(this));
42 $('browsePrivateKey').addEventListener('click', 42 $('browsePrivateKey').addEventListener('click',
43 this.handleBrowsePrivateKey_.bind(this)); 43 this.handleBrowsePrivateKey_.bind(this));
44 }, 44 },
45 45
46 /** 46 /**
47 * Utility function which asks the C++ to show a platform-specific file 47 * Utility function which asks the C++ to show a platform-specific file
48 * select dialog, and fire |callback| with the |filePath| that resulted. 48 * select dialog, and fire |callback| with the |filePath| that resulted.
49 * |selectType| can be either 'file' or 'folder'. |operation| can be 'load', 49 * |selectType| can be either 'file' or 'folder'. |operation| can be 'load',
50 * 'packRoot', or 'pem' which are signals to the C++ to do some 50 * or 'pem' which are signals to the C++ to do some operation-specific
51 * operation-specific configuration. 51 * configuration.
52 * @private 52 * @private
53 */ 53 */
54 showFileDialog_: function(selectType, operation, callback) { 54 showFileDialog_: function(selectType, operation, callback) {
55 handleFilePathSelected = function(filePath) { 55 // |window.handleFilePathSelected| will be called from the C++ handler
56 // once the user selects a path.
57 window.handleFilePathSelected = function(filePath) {
56 callback(filePath); 58 callback(filePath);
57 handleFilePathSelected = function() {}; 59 handleFilePathSelected = function() {};
58 }; 60 };
59 61
60 chrome.send('extensionSettingsSelectFilePath', [selectType, operation]); 62 chrome.send('packExtensionSelectFilePath', [selectType, operation]);
61 }, 63 },
62 64
63 /** 65 /**
64 * Handles the showing of the extension directory browser. 66 * Handles the showing of the extension directory browser.
65 * @param {Event} e Change event. 67 * @param {Event} e Change event.
66 * @private 68 * @private
67 */ 69 */
68 handleBrowseExtensionDir_: function(e) { 70 handleBrowseExtensionDir_: function(e) {
69 this.showFileDialog_('folder', 'load', function(filePath) { 71 this.showFileDialog_('folder', 'load', function(filePath) {
70 $('extensionRootDir').value = filePath; 72 $('extensionRootDir').value = filePath;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 OptionsPage.closeOverlay(); 111 OptionsPage.closeOverlay();
110 OptionsPage.showPageByName('packExtensionOverlay', false); 112 OptionsPage.showPageByName('packExtensionOverlay', false);
111 }, null); 113 }, null);
112 } 114 }
113 115
114 // Export 116 // Export
115 return { 117 return {
116 PackExtensionOverlay: PackExtensionOverlay 118 PackExtensionOverlay: PackExtensionOverlay
117 }; 119 };
118 }); 120 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698