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

Unified Diff: chrome/browser/extensions/sandboxed_unpacker.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/extensions/sandboxed_unpacker.cc
diff --git a/chrome/browser/extensions/sandboxed_unpacker.cc b/chrome/browser/extensions/sandboxed_unpacker.cc
index d07eeeae757daf222561df418d323f91c6c2e908..efe6f8f2893cfb9049d352bca1d1be3eb18f595c 100644
--- a/chrome/browser/extensions/sandboxed_unpacker.cc
+++ b/chrome/browser/extensions/sandboxed_unpacker.cc
@@ -223,6 +223,7 @@ SandboxedUnpacker::SandboxedUnpacker(
client_(client),
extensions_dir_(extensions_dir),
got_response_(false),
+ is_zipfile_(false),
location_(location),
creation_flags_(creation_flags),
unpacker_io_task_runner_(unpacker_io_task_runner) {
@@ -260,6 +261,9 @@ void SandboxedUnpacker::Start() {
unpack_start_time_ = base::TimeTicks::Now();
+ if (crx_path_.Extension() == ".zip")
+ is_zipfile_ = true;
meacer 2014/07/28 23:01:05 Cleaner? is_zipfile_ = crx_path_.Extension() == "
elijahtaylor1 2014/07/31 17:29:55 removed code
+
PATH_LENGTH_HISTOGRAM("Extensions.SandboxUnpackInitialCrxPathLength",
crx_path_);
if (!CreateTempDirectory())
@@ -361,6 +365,11 @@ void SandboxedUnpacker::OnUnpackExtensionSucceeded(
CHECK(unpacker_io_task_runner_->RunsTasksOnCurrentThread());
got_response_ = true;
+ if (is_zipfile_) {
+ ReportSuccess(manifest, SkBitmap());
+ return;
+ }
+
scoped_ptr<base::DictionaryValue> final_manifest(
RewriteManifestFile(manifest));
if (!final_manifest)
@@ -421,6 +430,9 @@ void SandboxedUnpacker::OnUnpackExtensionFailed(const base::string16& error) {
}
bool SandboxedUnpacker::ValidateSignature() {
+ if (is_zipfile_)
+ return true;
+
base::ScopedFILE file(base::OpenFile(crx_path_, "rb"));
if (!file.get()) {

Powered by Google App Engine
This is Rietveld 408576698