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

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

Issue 12578008: Move CrxFile, FileReader, ExtensionResource to src/extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 9 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 ea0c03b07e50c0b190540fe588ade0568cb7bc23..527cd341c5278be9350a94ee4dd538dd2d541d2d 100644
--- a/chrome/browser/extensions/sandboxed_unpacker.cc
+++ b/chrome/browser/extensions/sandboxed_unpacker.cc
@@ -18,7 +18,6 @@
#include "base/path_service.h"
#include "base/sequenced_task_runner.h"
#include "base/utf_string_conversions.h" // TODO(viettrungluu): delete me.
-#include "chrome/browser/extensions/crx_file.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
@@ -32,6 +31,9 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/utility_process_host.h"
#include "crypto/signature_verifier.h"
+#include "extensions/common/constants.h"
+#include "extensions/common/crx_file.h"
+#include "extensions/common/id_util.h"
#include "grit/generated_resources.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/l10n/l10n_util.h"
@@ -557,8 +559,7 @@ bool SandboxedUnpacker::ValidateSignature() {
std::string(reinterpret_cast<char*>(&key.front()), key.size());
base::Base64Encode(public_key, &public_key_);
- if (!Extension::GenerateId(public_key, &extension_id_))
- return false;
+ extension_id_ = id_util::GenerateId(public_key);
return true;
}
@@ -610,7 +611,7 @@ DictionaryValue* SandboxedUnpacker::RewriteManifestFile(
}
base::FilePath manifest_path =
- extension_root_.Append(Extension::kManifestFilename);
+ extension_root_.Append(kManifestFilename);
if (!file_util::WriteFile(manifest_path,
manifest_json.data(), manifest_json.size())) {
// Error saving manifest.json.
@@ -749,7 +750,7 @@ bool SandboxedUnpacker::RewriteCatalogFiles() {
// hack and remove the corresponding #include.
base::FilePath relative_path =
base::FilePath::FromWStringHack(UTF8ToWide(it.key()));
- relative_path = relative_path.Append(Extension::kMessagesFilename);
+ relative_path = relative_path.Append(kMessagesFilename);
if (relative_path.IsAbsolute() || relative_path.ReferencesParent()) {
// Invalid path for catalog.
ReportFailure(
« no previous file with comments | « chrome/browser/extensions/installed_loader.cc ('k') | chrome/browser/extensions/sandboxed_unpacker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698