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

Unified Diff: chrome/browser/extensions/sandboxed_extension_unpacker.cc

Issue 8423003: Enable experimental permissions for extensions from the store. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Windows compile warning Created 9 years, 2 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_extension_unpacker.cc
diff --git a/chrome/browser/extensions/sandboxed_extension_unpacker.cc b/chrome/browser/extensions/sandboxed_extension_unpacker.cc
index 987eb8b731faefda7766e3ba0e441f9e15230389..69dd6f91ce071844784f97e688a42d8b959d57b7 100644
--- a/chrome/browser/extensions/sandboxed_extension_unpacker.cc
+++ b/chrome/browser/extensions/sandboxed_extension_unpacker.cc
@@ -20,7 +20,6 @@
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_utility_messages.h"
-#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/extension_file_util.h"
#include "chrome/common/extensions/extension_l10n_util.h"
@@ -112,12 +111,13 @@ void RecordSuccessfulUnpackTimeHistograms(
SandboxedExtensionUnpacker::SandboxedExtensionUnpacker(
const FilePath& crx_path,
ResourceDispatcherHost* rdh,
+ Extension::Location location,
int creation_flags,
SandboxedExtensionUnpackerClient* client)
: crx_path_(crx_path),
thread_identifier_(BrowserThread::ID_COUNT),
rdh_(rdh), client_(client), got_response_(false),
- creation_flags_(creation_flags) {
+ location_(location), creation_flags_(creation_flags) {
}
bool SandboxedExtensionUnpacker::CreateTempDirectory() {
@@ -214,7 +214,7 @@ void SandboxedExtensionUnpacker::Start() {
link_free_crx_path));
} else {
// Otherwise, unpack the extension in this process.
- ExtensionUnpacker unpacker(temp_crx_path);
+ ExtensionUnpacker unpacker(temp_crx_path, location_, creation_flags_);
if (unpacker.Run() && unpacker.DumpImagesToFile() &&
unpacker.DumpMessageCatalogsToFile()) {
OnUnpackExtensionSucceeded(*unpacker.parsed_manifest());
@@ -262,7 +262,9 @@ void SandboxedExtensionUnpacker::StartProcessOnIOThread(
// Grant the subprocess access to the entire subdir the extension file is
// in, so that it can unpack to that dir.
host->set_exposed_dir(temp_crx_path.DirName());
- host->Send(new ChromeUtilityMsg_UnpackExtension(temp_crx_path));
+ host->Send(
+ new ChromeUtilityMsg_UnpackExtension(
+ temp_crx_path, location_, creation_flags_));
}
void SandboxedExtensionUnpacker::OnUnpackExtensionSucceeded(
@@ -296,7 +298,7 @@ void SandboxedExtensionUnpacker::OnUnpackExtensionSucceeded(
extension_ = Extension::Create(
extension_root_,
- Extension::INTERNAL,
+ location_,
*final_manifest,
Extension::REQUIRE_KEY | creation_flags_,
&error);

Powered by Google App Engine
This is Rietveld 408576698