Chromium Code Reviews| 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(); |