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 <include src="../uber/uber_utils.js"></include> | 5 <include src="../uber/uber_utils.js"></include> |
6 <include src="extension_code.js"></include> | 6 <include src="extension_code.js"></include> |
7 <include src="extension_commands_overlay.js"></include> | 7 <include src="extension_commands_overlay.js"></include> |
8 <include src="extension_focus_manager.js"></include> | 8 <include src="extension_focus_manager.js"></include> |
9 <include src="extension_list.js"></include> | 9 <include src="extension_list.js"></include> |
10 <include src="pack_extension_overlay.js"></include> | 10 <include src="pack_extension_overlay.js"></include> |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 }); |
OLD | NEW |