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

Unified Diff: chrome/browser/ui/webui/extensions/install_extension_handler.cc

Issue 406713002: Allow drag-and-drop of zipped extensions on chrome://extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/extensions/install_extension_handler.cc
diff --git a/chrome/browser/ui/webui/extensions/install_extension_handler.cc b/chrome/browser/ui/webui/extensions/install_extension_handler.cc
index b0770b8c1e1317bd5427dbe182cf0d36c4e9feef..c9cc0311dd6cb1f0679ea458e8dff9a22be24f2f 100644
--- a/chrome/browser/ui/webui/extensions/install_extension_handler.cc
+++ b/chrome/browser/ui/webui/extensions/install_extension_handler.cc
@@ -99,30 +99,36 @@ void InstallExtensionHandler::HandleInstallMessage(
Profile* profile = Profile::FromBrowserContext(
web_ui()->GetWebContents()->GetBrowserContext());
- scoped_ptr<ExtensionInstallPrompt> prompt(
- new ExtensionInstallPrompt(web_ui()->GetWebContents()));
- scoped_refptr<CrxInstaller> crx_installer(CrxInstaller::Create(
- ExtensionSystem::Get(profile)->extension_service(),
- prompt.Pass()));
- crx_installer->set_error_on_unsupported_requirements(true);
- crx_installer->set_off_store_install_allow_reason(
- CrxInstaller::OffStoreInstallAllowedFromSettingsPage);
- crx_installer->set_install_immediately(true);
const bool kCaseSensitive = false;
- if (EndsWith(file_display_name_,
- base::ASCIIToUTF16(".user.js"),
- kCaseSensitive)) {
- crx_installer->InstallUserScript(
- file_to_install_,
- net::FilePathToFileURL(file_to_install_));
- } else if (EndsWith(file_display_name_,
- base::ASCIIToUTF16(".crx"),
- kCaseSensitive)) {
- crx_installer->InstallCrx(file_to_install_);
+ if (EndsWith(
+ file_display_name_, base::ASCIIToUTF16(".zip"), kCaseSensitive)) {
asargent_no_longer_on_chrome 2014/07/29 21:38:10 should this be case insensitive?
elijahtaylor1 2014/07/31 17:26:27 This is unfortunately named, but is set false abov
+ UnpackedInstaller::Create(
+ ExtensionSystem::Get(profile)->extension_service())
+ ->LoadFromZipFile(file_to_install_);
} else {
- CHECK(false);
+ scoped_ptr<ExtensionInstallPrompt> prompt(
+ new ExtensionInstallPrompt(web_ui()->GetWebContents()));
+ scoped_refptr<CrxInstaller> crx_installer(CrxInstaller::Create(
+ ExtensionSystem::Get(profile)->extension_service(), prompt.Pass()));
+ crx_installer->set_error_on_unsupported_requirements(true);
+ crx_installer->set_off_store_install_allow_reason(
+ CrxInstaller::OffStoreInstallAllowedFromSettingsPage);
+ crx_installer->set_install_immediately(true);
+
+ if (EndsWith(file_display_name_,
+ base::ASCIIToUTF16(".user.js"),
+ kCaseSensitive)) {
+ crx_installer->InstallUserScript(
+ file_to_install_, net::FilePathToFileURL(file_to_install_));
+ } else if (EndsWith(file_display_name_,
+ base::ASCIIToUTF16(".crx"),
+ kCaseSensitive)) {
+ crx_installer->InstallCrx(file_to_install_);
+ } else {
+ CHECK(false);
+ }
}
file_to_install_.clear();

Powered by Google App Engine
This is Rietveld 408576698