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

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

Issue 406713002: Allow drag-and-drop of zipped extensions on chrome://extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use registryobserver, remove zipfileinstallerclient Created 6 years, 4 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 <include src="../uber/uber_utils.js"> 5 <include src="../uber/uber_utils.js">
6 <include src="extension_code.js"> 6 <include src="extension_code.js">
7 <include src="extension_commands_overlay.js"> 7 <include src="extension_commands_overlay.js">
8 <include src="extension_focus_manager.js"> 8 <include src="extension_focus_manager.js">
9 <include src="extension_list.js"> 9 <include src="extension_list.js">
10 <include src="pack_extension_overlay.js"> 10 <include src="pack_extension_overlay.js">
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // its item entry. 59 // its item entry.
60 for (var i = 0; i < e.dataTransfer.items.length; ++i) { 60 for (var i = 0; i < e.dataTransfer.items.length; ++i) {
61 if (e.dataTransfer.items[i].kind == 'file' && 61 if (e.dataTransfer.items[i].kind == 'file' &&
62 e.dataTransfer.items[i].webkitGetAsEntry().isDirectory) { 62 e.dataTransfer.items[i].webkitGetAsEntry().isDirectory) {
63 toSend = 'installDroppedDirectory'; 63 toSend = 'installDroppedDirectory';
64 break; 64 break;
65 } 65 }
66 } 66 }
67 // Only process files that look like extensions. Other files should 67 // Only process files that look like extensions. Other files should
68 // navigate the browser normally. 68 // navigate the browser normally.
69 if (!toSend && /\.(crx|user\.js)$/i.test(e.dataTransfer.files[0].name)) 69 if (!toSend &&
70 /\.(crx|user\.js|zip)$/i.test(e.dataTransfer.files[0].name)) {
70 toSend = 'installDroppedFile'; 71 toSend = 'installDroppedFile';
72 }
71 73
72 if (toSend) { 74 if (toSend) {
73 e.preventDefault(); 75 e.preventDefault();
74 chrome.send(toSend); 76 chrome.send(toSend);
75 } 77 }
76 } 78 }
77 }; 79 };
78 80
79 /** 81 /**
80 * ExtensionSettings class 82 * ExtensionSettings class
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 var style = document.createElement('style'); 425 var style = document.createElement('style');
424 style.type = 'text/css'; 426 style.type = 'text/css';
425 style.textContent = 427 style.textContent =
426 '.enable-checkbox-text {' + 428 '.enable-checkbox-text {' +
427 ' min-width: ' + (pxWidth - trashWidth) + 'px;' + 429 ' min-width: ' + (pxWidth - trashWidth) + 'px;' +
428 '}' + 430 '}' +
429 '#dev-toggle span {' + 431 '#dev-toggle span {' +
430 ' min-width: ' + pxWidth + 'px;' + 432 ' min-width: ' + pxWidth + 'px;' +
431 '}'; 433 '}';
432 document.querySelector('head').appendChild(style); 434 document.querySelector('head').appendChild(style);
433 } 435 };
434 436
435 // Export 437 // Export
436 return { 438 return {
437 ExtensionSettings: ExtensionSettings 439 ExtensionSettings: ExtensionSettings
438 }; 440 };
439 }); 441 });
440 442
441 window.addEventListener('load', function(e) { 443 window.addEventListener('load', function(e) {
442 extensions.ExtensionSettings.getInstance().initialize(); 444 extensions.ExtensionSettings.getInstance().initialize();
443 }); 445 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698