summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/download/chrome_download_manager_delegate.cc4
-rw-r--r--chrome/browser/download/download_target_determiner.cc4
-rw-r--r--chrome/browser/extensions/extension_protocols.cc2
-rw-r--r--chrome/browser/extensions/pack_extension_job.cc6
-rw-r--r--chrome/browser/extensions/sandboxed_unpacker.cc8
-rw-r--r--chrome/browser/extensions/sandboxed_unpacker_unittest.cc3
-rw-r--r--chrome/chrome_common.gypi2
-rw-r--r--chrome/common/chrome_constants.cc2
-rw-r--r--chrome/common/chrome_constants.h2
-rw-r--r--chrome/common/extensions/background_info.cc5
-rw-r--r--chrome/common/extensions/extension.cc8
-rw-r--r--chrome/common/extensions/extension.h3
-rw-r--r--chrome/common/extensions/extension_constants.cc18
-rw-r--r--chrome/common/extensions/extension_constants.h20
-rw-r--r--chrome/common/extensions/extension_file_util.cc3
-rw-r--r--chrome/common/extensions/manifest_handlers/shared_module_info.cc9
-rw-r--r--chrome/common/extensions/manifest_tests/extension_manifests_background_unittest.cc3
-rw-r--r--chrome/common_constants.gyp3
-rw-r--r--chrome/installer/setup/DEPS1
-rw-r--r--chrome/installer/setup/uninstall.cc3
-rw-r--r--chrome/utility/extensions/unpacker.cc8
-rw-r--r--chrome/utility/extensions/unpacker_unittest.cc5
-rw-r--r--extensions/common/constants.cc20
-rw-r--r--extensions/common/constants.h24
24 files changed, 76 insertions, 90 deletions
diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc
index 7331349..70e69a8 100644
--- a/chrome/browser/download/chrome_download_manager_delegate.cc
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc
@@ -34,12 +34,12 @@
#include "chrome/browser/platform_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
-#include "chrome/common/extensions/extension.h"
#include "chrome/common/pref_names.h"
#include "components/user_prefs/pref_registry_syncable.h"
#include "content/public/browser/download_item.h"
#include "content/public/browser/download_manager.h"
#include "content/public/browser/notification_source.h"
+#include "extensions/common/constants.h"
#if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/drive/download_handler.h"
@@ -231,7 +231,7 @@ bool ChromeDownloadManagerDelegate::ShouldOpenFileBasedOnExtension(
// TODO(asanka): This determination is done based on |path|, while
// ShouldOpenDownload() detects extension downloads based on the
// characteristics of the download. Reconcile this. http://crbug.com/167702
- if (extensions::Extension::IsExtension(path))
+ if (path.MatchesExtension(extensions::kExtensionFileExtension))
return false;
return download_prefs_->IsAutoOpenEnabledBasedOnExtension(path);
}
diff --git a/chrome/browser/download/download_target_determiner.cc b/chrome/browser/download/download_target_determiner.cc
index 794886f2..02429b4e 100644
--- a/chrome/browser/download/download_target_determiner.cc
+++ b/chrome/browser/download/download_target_determiner.cc
@@ -17,12 +17,12 @@
#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/feature_switch.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/download_interrupt_reasons.h"
+#include "extensions/common/constants.h"
#include "grit/generated_resources.h"
#include "net/base/net_util.h"
#include "ui/base/l10n/l10n_util.h"
@@ -551,7 +551,7 @@ bool DownloadTargetDeterminer::ShouldPromptForDownload(
// don't bother asking where to keep it.
if (download_prefs_->PromptForDownload() &&
!download_crx_util::IsExtensionDownload(*download_) &&
- !extensions::Extension::IsExtension(filename) &&
+ !filename.MatchesExtension(extensions::kExtensionFileExtension) &&
!download_prefs_->IsAutoOpenEnabledBasedOnExtension(filename))
return true;
diff --git a/chrome/browser/extensions/extension_protocols.cc b/chrome/browser/extensions/extension_protocols.cc
index 2ec1145..2385d0e 100644
--- a/chrome/browser/extensions/extension_protocols.cc
+++ b/chrome/browser/extensions/extension_protocols.cc
@@ -482,7 +482,7 @@ ExtensionProtocolHandler::MaybeCreateJob(
std::string path = request->url().path();
if (path.size() > 1 &&
- path.substr(1) == extension_filenames::kGeneratedBackgroundPageFilename) {
+ path.substr(1) == extensions::kGeneratedBackgroundPageFilename) {
return new GeneratedBackgroundPageJob(
request, network_delegate, extension, content_security_policy);
}
diff --git a/chrome/browser/extensions/pack_extension_job.cc b/chrome/browser/extensions/pack_extension_job.cc
index 744eb62..da182b1 100644
--- a/chrome/browser/extensions/pack_extension_job.cc
+++ b/chrome/browser/extensions/pack_extension_job.cc
@@ -9,7 +9,7 @@
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/extensions/extension_creator.h"
-#include "chrome/common/chrome_constants.h"
+#include "extensions/common/constants.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
@@ -45,11 +45,11 @@ PackExtensionJob::~PackExtensionJob() {}
void PackExtensionJob::Run() {
crx_file_out_ = base::FilePath(root_directory_.value() +
- chrome::kExtensionFileExtension);
+ kExtensionFileExtension);
if (key_file_.empty())
key_file_out_ = base::FilePath(root_directory_.value() +
- chrome::kExtensionKeyFileExtension);
+ kExtensionKeyFileExtension);
// TODO(aa): Need to internationalize the errors that ExtensionCreator
// returns. See bug 20734.
diff --git a/chrome/browser/extensions/sandboxed_unpacker.cc b/chrome/browser/extensions/sandboxed_unpacker.cc
index e2b317f..30d6c94 100644
--- a/chrome/browser/extensions/sandboxed_unpacker.cc
+++ b/chrome/browser/extensions/sandboxed_unpacker.cc
@@ -24,7 +24,6 @@
#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"
#include "chrome/common/extensions/extension_manifest_constants.h"
@@ -182,7 +181,7 @@ bool FindWritableTempLocation(const base::FilePath& extensions_dir,
bool ReadImagesFromFile(const base::FilePath& extension_path,
DecodedImages* images) {
base::FilePath path =
- extension_path.AppendASCII(extension_filenames::kDecodedImagesFilename);
+ extension_path.AppendASCII(kDecodedImagesFilename);
std::string file_str;
if (!file_util::ReadFileToString(path, &file_str))
return false;
@@ -198,7 +197,7 @@ bool ReadImagesFromFile(const base::FilePath& extension_path,
bool ReadMessageCatalogsFromFile(const base::FilePath& extension_path,
base::DictionaryValue* catalogs) {
base::FilePath path = extension_path.AppendASCII(
- extension_filenames::kDecodedMessageCatalogsFilename);
+ kDecodedMessageCatalogsFilename);
std::string file_str;
if (!file_util::ReadFileToString(path, &file_str))
return false;
@@ -264,8 +263,7 @@ void SandboxedUnpacker::Start() {
return; // ReportFailure() already called.
// Initialize the path that will eventually contain the unpacked extension.
- extension_root_ = temp_dir_.path().AppendASCII(
- extension_filenames::kTempExtensionName);
+ extension_root_ = temp_dir_.path().AppendASCII(kTempExtensionName);
PATH_LENGTH_HISTOGRAM("Extensions.SandboxUnpackUnpackedCrxPathLength",
extension_root_);
diff --git a/chrome/browser/extensions/sandboxed_unpacker_unittest.cc b/chrome/browser/extensions/sandboxed_unpacker_unittest.cc
index 1bf0018..39f634e 100644
--- a/chrome/browser/extensions/sandboxed_unpacker_unittest.cc
+++ b/chrome/browser/extensions/sandboxed_unpacker_unittest.cc
@@ -97,8 +97,7 @@ class SandboxedUnpackerTest : public testing::Test {
}
base::FilePath GetInstallPath() {
- return client_->temp_dir().AppendASCII(
- extension_filenames::kTempExtensionName);
+ return client_->temp_dir().AppendASCII(kTempExtensionName);
}
protected:
diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi
index 2d3dcd5..eb1c2f9 100644
--- a/chrome/chrome_common.gypi
+++ b/chrome/chrome_common.gypi
@@ -53,8 +53,6 @@
'sources': [
'../apps/app_shim/app_shim_launch.h',
'../apps/app_shim/app_shim_messages.h',
- '../extensions/common/constants.cc',
- '../extensions/common/constants.h',
'../extensions/common/crx_file.cc',
'../extensions/common/crx_file.h',
'../extensions/common/draggable_region.cc',
diff --git a/chrome/common/chrome_constants.cc b/chrome/common/chrome_constants.cc
index f6960d0..25e5d05 100644
--- a/chrome/common/chrome_constants.cc
+++ b/chrome/common/chrome_constants.cc
@@ -144,8 +144,6 @@ const char kInitialProfile[] = "Default";
const char kMultiProfileDirPrefix[] = "Profile ";
const base::FilePath::CharType kGuestProfileDir[] = FPL("Guest Profile");
const wchar_t kBrowserResourcesDll[] = L"chrome.dll";
-const base::FilePath::CharType kExtensionFileExtension[] = FPL(".crx");
-const base::FilePath::CharType kExtensionKeyFileExtension[] = FPL(".pem");
// filenames
#if defined(OS_ANDROID)
diff --git a/chrome/common/chrome_constants.h b/chrome/common/chrome_constants.h
index 03d57ba..195b4c8 100644
--- a/chrome/common/chrome_constants.h
+++ b/chrome/common/chrome_constants.h
@@ -46,8 +46,6 @@ extern const char kInitialProfile[];
extern const char kMultiProfileDirPrefix[];
extern const base::FilePath::CharType kGuestProfileDir[];
extern const wchar_t kBrowserResourcesDll[];
-extern const base::FilePath::CharType kExtensionFileExtension[];
-extern const base::FilePath::CharType kExtensionKeyFileExtension[];
// filenames
#if defined(OS_ANDROID)
diff --git a/chrome/common/extensions/background_info.cc b/chrome/common/extensions/background_info.cc
index 8d21f5d..ae25782 100644
--- a/chrome/common/extensions/background_info.cc
+++ b/chrome/common/extensions/background_info.cc
@@ -11,11 +11,11 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/common/chrome_switches.h"
-#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/extension_file_util.h"
#include "chrome/common/extensions/extension_manifest_constants.h"
#include "chrome/common/extensions/permissions/api_permission_set.h"
#include "chrome/common/extensions/permissions/permissions_data.h"
+#include "extensions/common/constants.h"
#include "extensions/common/error_utils.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
@@ -57,8 +57,7 @@ GURL BackgroundInfo::GetBackgroundURL(const Extension* extension) {
const BackgroundInfo& info = GetBackgroundInfo(extension);
if (info.background_scripts_.empty())
return info.background_url_;
- return extension->GetResourceURL(
- extension_filenames::kGeneratedBackgroundPageFilename);
+ return extension->GetResourceURL(kGeneratedBackgroundPageFilename);
}
// static
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 8afdbd5..9c94936 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -20,7 +20,6 @@
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "base/version.h"
-#include "chrome/common/chrome_constants.h"
#include "chrome/common/extensions/extension_manifest_constants.h"
#include "chrome/common/extensions/manifest.h"
#include "chrome/common/extensions/manifest_handler.h"
@@ -28,7 +27,7 @@
#include "chrome/common/extensions/permissions/permission_set.h"
#include "chrome/common/extensions/permissions/permissions_data.h"
#include "chrome/common/extensions/permissions/permissions_info.h"
-#include "chrome/common/url_constants.h"
+#include "content/public/common/url_constants.h"
#include "extensions/common/constants.h"
#include "extensions/common/error_utils.h"
#include "extensions/common/id_util.h"
@@ -185,11 +184,6 @@ bool Extension::IdIsValid(const std::string& id) {
return true;
}
-// static
-bool Extension::IsExtension(const base::FilePath& file_name) {
- return file_name.MatchesExtension(chrome::kExtensionFileExtension);
-}
-
Manifest::Type Extension::GetType() const {
return converted_from_user_script() ?
Manifest::TYPE_USER_SCRIPT : manifest_->type();
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h
index 3840266d..394b927 100644
--- a/chrome/common/extensions/extension.h
+++ b/chrome/common/extensions/extension.h
@@ -178,9 +178,6 @@ class Extension : public base::RefCountedThreadSafe<Extension> {
// Checks to see if the extension has a valid ID.
static bool IdIsValid(const std::string& id);
- // Returns true if the specified file is an extension.
- static bool IsExtension(const base::FilePath& file_name);
-
// See Type definition in Manifest.
Manifest::Type GetType() const;
diff --git a/chrome/common/extensions/extension_constants.cc b/chrome/common/extensions/extension_constants.cc
index 1ca0105..04e2343 100644
--- a/chrome/common/extensions/extension_constants.cc
+++ b/chrome/common/extensions/extension_constants.cc
@@ -90,24 +90,6 @@ const char kGalleryBrowsePrefix[] = "https://chrome.google.com/webstore";
} // namespace extension_urls
-namespace extension_filenames {
-
-const char kTempExtensionName[] = "CRX_INSTALL";
-
-// The file to write our decoded images to, relative to the extension_path.
-const char kDecodedImagesFilename[] = "DECODED_IMAGES";
-
-// The file to write our decoded message catalogs to, relative to the
-// extension_path.
-const char kDecodedMessageCatalogsFilename[] = "DECODED_MESSAGE_CATALOGS";
-
-const char kGeneratedBackgroundPageFilename[] =
- "_generated_background_page.html";
-
-const char kModulesDir[] = "_modules";
-
-} // namespace extension_filenames
-
namespace extension_misc {
const char kBookmarkManagerId[] = "eemcgdkfndhakfknompkggombfjjjeno";
diff --git a/chrome/common/extensions/extension_constants.h b/chrome/common/extensions/extension_constants.h
index e4def4c..8f688cd 100644
--- a/chrome/common/extensions/extension_constants.h
+++ b/chrome/common/extensions/extension_constants.h
@@ -56,26 +56,6 @@ namespace extension_urls {
extern const char kGalleryBrowsePrefix[];
} // namespace extension_urls
-namespace extension_filenames {
- // The name of a temporary directory to install an extension into for
- // validation before finalizing install.
- extern const char kTempExtensionName[];
-
- // The file to write our decoded images to, relative to the extension_path.
- extern const char kDecodedImagesFilename[];
-
- // The file to write our decoded message catalogs to, relative to the
- // extension_path.
- extern const char kDecodedMessageCatalogsFilename[];
-
- // The filename to use for a background page generated from
- // background.scripts.
- extern const char kGeneratedBackgroundPageFilename[];
-
- // Path to imported modules.
- extern const char kModulesDir[];
-}
-
namespace extension_misc {
// Matches chrome.windows.WINDOW_ID_NONE.
const int kUnknownWindowId = -1;
diff --git a/chrome/common/extensions/extension_file_util.cc b/chrome/common/extensions/extension_file_util.cc
index 16b1e54..29ed5ca 100644
--- a/chrome/common/extensions/extension_file_util.cc
+++ b/chrome/common/extensions/extension_file_util.cc
@@ -18,7 +18,6 @@
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_restrictions.h"
-#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/extensions/api/extension_action/action_info.h"
#include "chrome/common/extensions/extension.h"
@@ -208,7 +207,7 @@ std::vector<base::FilePath> FindPrivateKeyFiles(
base::FileEnumerator::FILES);
for (base::FilePath current = traversal.Next(); !current.empty();
current = traversal.Next()) {
- if (!current.MatchesExtension(chrome::kExtensionKeyFileExtension))
+ if (!current.MatchesExtension(extensions::kExtensionKeyFileExtension))
continue;
std::string key_contents;
diff --git a/chrome/common/extensions/manifest_handlers/shared_module_info.cc b/chrome/common/extensions/manifest_handlers/shared_module_info.cc
index f1f965a..dd906b4 100644
--- a/chrome/common/extensions/manifest_handlers/shared_module_info.cc
+++ b/chrome/common/extensions/manifest_handlers/shared_module_info.cc
@@ -10,9 +10,9 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/version.h"
-#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/extension_manifest_constants.h"
#include "chrome/common/extensions/permissions/permission_set.h"
+#include "extensions/common/constants.h"
#include "extensions/common/error_utils.h"
namespace keys = extension_manifest_keys;
@@ -50,7 +50,7 @@ void SharedModuleInfo::ParseImportedPath(const std::string& path,
std::string* import_relative_path) {
std::vector<std::string> tokens;
Tokenize(path, std::string("/"), &tokens);
- if (tokens.size() > 2 && tokens[0] == extension_filenames::kModulesDir &&
+ if (tokens.size() > 2 && tokens[0] == kModulesDir &&
Extension::IdIsValid(tokens[1])) {
*import_id = tokens[1];
*import_relative_path = tokens[2];
@@ -63,7 +63,7 @@ void SharedModuleInfo::ParseImportedPath(const std::string& path,
bool SharedModuleInfo::IsImportedPath(const std::string& path) {
std::vector<std::string> tokens;
Tokenize(path, std::string("/"), &tokens);
- if (tokens.size() > 2 && tokens[0] == extension_filenames::kModulesDir &&
+ if (tokens.size() > 2 && tokens[0] == kModulesDir &&
Extension::IdIsValid(tokens[1])) {
return true;
}
@@ -224,5 +224,4 @@ const std::vector<std::string> SharedModuleHandler::Keys() const {
return std::vector<std::string>(keys, keys + arraysize(keys));
}
-} // extensions
-
+} // namespace extensions
diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_background_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_background_unittest.cc
index 7b49ccab..a6fcab1 100644
--- a/chrome/common/extensions/manifest_tests/extension_manifests_background_unittest.cc
+++ b/chrome/common/extensions/manifest_tests/extension_manifests_background_unittest.cc
@@ -13,6 +13,7 @@
#include "chrome/common/extensions/extension_manifest_constants.h"
#include "chrome/common/extensions/features/base_feature_provider.h"
#include "chrome/common/extensions/features/feature.h"
+#include "extensions/common/constants.h"
#include "extensions/common/error_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -46,7 +47,7 @@ TEST_F(ExtensionManifestBackgroundTest, BackgroundScripts) {
EXPECT_TRUE(BackgroundInfo::HasBackgroundPage(extension.get()));
EXPECT_EQ(
- std::string("/") + extension_filenames::kGeneratedBackgroundPageFilename,
+ std::string("/") + kGeneratedBackgroundPageFilename,
BackgroundInfo::GetBackgroundURL(extension.get()).path());
manifest->SetString("background_page", "monkey.html");
diff --git a/chrome/common_constants.gyp b/chrome/common_constants.gyp
index b0ee2cd..3cb4843d 100644
--- a/chrome/common_constants.gyp
+++ b/chrome/common_constants.gyp
@@ -13,6 +13,9 @@
'target_defaults': {
'sources': [
+ # TODO(yoz): Create an extension_constants target for these.
+ '../extensions/common/constants.cc',
+ '../extensions/common/constants.h',
'common/chrome_constants.cc',
'common/chrome_constants.h',
'common/chrome_paths.cc',
diff --git a/chrome/installer/setup/DEPS b/chrome/installer/setup/DEPS
index a96cf4b..3a8062c 100644
--- a/chrome/installer/setup/DEPS
+++ b/chrome/installer/setup/DEPS
@@ -1,4 +1,5 @@
include_rules = [
"+chrome/app",
"+courgette",
+ "+extensions/common/constants.h",
]
diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc
index c0847a2..30af416 100644
--- a/chrome/installer/setup/uninstall.cc
+++ b/chrome/installer/setup/uninstall.cc
@@ -45,6 +45,7 @@
#include "chrome/installer/util/shell_util.h"
#include "chrome/installer/util/util_constants.h"
#include "content/public/common/result_codes.h"
+#include "extensions/common/constants.h"
#include "rlz/lib/rlz_lib.h"
// Build-time generated include file.
@@ -908,7 +909,7 @@ const wchar_t kChromeExtProgId[] = L"ChromiumExt";
// Delete Software\Classes\.crx,
string16 ext_association(ShellUtil::kRegClasses);
ext_association.append(L"\\");
- ext_association.append(chrome::kExtensionFileExtension);
+ ext_association.append(extensions::kExtensionFileExtension);
InstallUtil::DeleteRegistryKey(roots[i], ext_association);
}
}
diff --git a/chrome/utility/extensions/unpacker.cc b/chrome/utility/extensions/unpacker.cc
index 4ae8853..e6bb4bc 100644
--- a/chrome/utility/extensions/unpacker.cc
+++ b/chrome/utility/extensions/unpacker.cc
@@ -23,7 +23,6 @@
#include "chrome/common/extensions/extension_l10n_util.h"
#include "chrome/common/extensions/extension_manifest_constants.h"
#include "chrome/common/extensions/manifest.h"
-#include "chrome/common/url_constants.h"
#include "content/public/child/image_decoder_utils.h"
#include "content/public/common/common_param_traits.h"
#include "extensions/common/constants.h"
@@ -37,7 +36,6 @@
namespace errors = extension_manifest_errors;
namespace keys = extension_manifest_keys;
-namespace filenames = extension_filenames;
namespace {
@@ -162,7 +160,7 @@ bool Unpacker::Run() {
// <profile>/Extensions/CRX_INSTALL
temp_install_dir_ =
- extension_path_.DirName().AppendASCII(filenames::kTempExtensionName);
+ extension_path_.DirName().AppendASCII(kTempExtensionName);
if (!file_util::CreateDirectory(temp_install_dir_)) {
SetUTF16Error(
@@ -229,7 +227,7 @@ bool Unpacker::DumpImagesToFile() {
IPC::WriteParam(&pickle, internal_data_->decoded_images);
base::FilePath path = extension_path_.DirName().AppendASCII(
- filenames::kDecodedImagesFilename);
+ kDecodedImagesFilename);
if (!file_util::WriteFile(path, static_cast<const char*>(pickle.data()),
pickle.size())) {
SetError("Could not write image data to disk.");
@@ -244,7 +242,7 @@ bool Unpacker::DumpMessageCatalogsToFile() {
IPC::WriteParam(&pickle, *parsed_catalogs_.get());
base::FilePath path = extension_path_.DirName().AppendASCII(
- filenames::kDecodedMessageCatalogsFilename);
+ kDecodedMessageCatalogsFilename);
if (!file_util::WriteFile(path, static_cast<const char*>(pickle.data()),
pickle.size())) {
SetError("Could not write message catalogs to disk.");
diff --git a/chrome/utility/extensions/unpacker_unittest.cc b/chrome/utility/extensions/unpacker_unittest.cc
index 3a66b29..8ddd737 100644
--- a/chrome/utility/extensions/unpacker_unittest.cc
+++ b/chrome/utility/extensions/unpacker_unittest.cc
@@ -10,14 +10,13 @@
#include "base/values.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/extensions/extension.h"
-#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/extension_manifest_constants.h"
#include "chrome/utility/extensions/unpacker.h"
+#include "extensions/common/constants.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkBitmap.h"
namespace errors = extension_manifest_errors;
-namespace filenames = extension_filenames;
namespace keys = extension_manifest_keys;
namespace extensions {
@@ -134,7 +133,7 @@ TEST_F(UnpackerTest, UnzipDirectoryError) {
const char* kExpected = "Could not create directory for unzipping: ";
SetupUnpacker("good_package.crx");
base::FilePath path =
- temp_dir_.path().AppendASCII(filenames::kTempExtensionName);
+ temp_dir_.path().AppendASCII(kTempExtensionName);
ASSERT_TRUE(file_util::WriteFile(path, "foo", 3));
EXPECT_FALSE(unpacker_->Run());
EXPECT_TRUE(StartsWith(unpacker_->error_message(),
diff --git a/extensions/common/constants.cc b/extensions/common/constants.cc
index f84386a..b739061 100644
--- a/extensions/common/constants.cc
+++ b/extensions/common/constants.cc
@@ -4,6 +4,8 @@
#include "extensions/common/constants.h"
+#include "base/files/file_path.h"
+
namespace extensions {
const char kExtensionScheme[] = "chrome-extension";
@@ -19,4 +21,20 @@ const base::FilePath::CharType kPlatformSpecificFolder[] =
const char kInstallDirectoryName[] = "Extensions";
-} // namespace extensions
+const char kTempExtensionName[] = "CRX_INSTALL";
+
+const char kDecodedImagesFilename[] = "DECODED_IMAGES";
+
+const char kDecodedMessageCatalogsFilename[] = "DECODED_MESSAGE_CATALOGS";
+
+const char kGeneratedBackgroundPageFilename[] =
+ "_generated_background_page.html";
+
+const char kModulesDir[] = "_modules";
+
+const base::FilePath::CharType kExtensionFileExtension[] =
+ FILE_PATH_LITERAL(".crx");
+const base::FilePath::CharType kExtensionKeyFileExtension[] =
+ FILE_PATH_LITERAL(".pem");
+
+} // namespace extensions
diff --git a/extensions/common/constants.h b/extensions/common/constants.h
index aeb9e67..492ddbc 100644
--- a/extensions/common/constants.h
+++ b/extensions/common/constants.h
@@ -28,6 +28,30 @@ extern const base::FilePath::CharType kPlatformSpecificFolder[];
// installed to.
extern const char kInstallDirectoryName[];
+// The name of a temporary directory to install an extension into for
+// validation before finalizing install.
+extern const char kTempExtensionName[];
+
+// The file to write our decoded images to, relative to the extension_path.
+extern const char kDecodedImagesFilename[];
+
+// The file to write our decoded message catalogs to, relative to the
+// extension_path.
+extern const char kDecodedMessageCatalogsFilename[];
+
+// The filename to use for a background page generated from
+// background.scripts.
+extern const char kGeneratedBackgroundPageFilename[];
+
+// Path to imported modules.
+extern const char kModulesDir[];
+
+// The file extension (.crx) for extensions.
+extern const base::FilePath::CharType kExtensionFileExtension[];
+
+// The file extension (.pem) for private key files.
+extern const base::FilePath::CharType kExtensionKeyFileExtension[];
+
} // namespace extensions
#endif // EXTENSIONS_COMMON_CONSTANTS_H_