Commit 15de8205 authored by elijahtaylor's avatar elijahtaylor Committed by Commit bot

Exclude zip-file loading from "Load Unpacked Extension"

This was only implemented half-way, and the file picker still limited
choices to directories.  So this code only got run (incorrectly)
by selecting a folder that ends in .zip (which happens on ChromeOS
for a mounted zip archive).

BUG=418753

Review URL: https://codereview.chromium.org/676503003

Cr-Commit-Position: refs/heads/master@{#301141}
parent 01a90f9a
...@@ -219,27 +219,14 @@ void ExtensionLoaderHandler::HandleDisplayFailures( ...@@ -219,27 +219,14 @@ void ExtensionLoaderHandler::HandleDisplayFailures(
void ExtensionLoaderHandler::LoadUnpackedExtensionImpl( void ExtensionLoaderHandler::LoadUnpackedExtensionImpl(
const base::FilePath& file_path) { const base::FilePath& file_path) {
if (EndsWith(file_path.AsUTF16Unsafe(), scoped_refptr<UnpackedInstaller> installer = UnpackedInstaller::Create(
base::ASCIIToUTF16(".zip"), ExtensionSystem::Get(profile_)->extension_service());
false /* case insensitive */)) {
scoped_refptr<ZipFileInstaller> installer = ZipFileInstaller::Create( // We do our own error handling, so we don't want a load failure to trigger
ExtensionSystem::Get(profile_)->extension_service()); // a dialog.
installer->set_be_noisy_on_failure(false);
// We do our own error handling, so we don't want a load failure to trigger
// a dialog. installer->Load(file_path);
installer->set_be_noisy_on_failure(false);
installer->LoadFromZipFile(file_path);
} else {
scoped_refptr<UnpackedInstaller> installer = UnpackedInstaller::Create(
ExtensionSystem::Get(profile_)->extension_service());
// We do our own error handling, so we don't want a load failure to trigger
// a dialog.
installer->set_be_noisy_on_failure(false);
installer->Load(file_path);
}
} }
void ExtensionLoaderHandler::OnLoadFailure( void ExtensionLoaderHandler::OnLoadFailure(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment