summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions
diff options
context:
space:
mode:
authoryoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-15 00:36:27 +0000
committeryoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-15 00:36:27 +0000
commit6bf9061f137de33b450f5ae9634b8c903bf2326d (patch)
treebf211f9108fdaafb0c065bb34d01fae62fc2e4bd /chrome/browser/extensions
parent5c10302fc35eff459864d872d33f0091a521c98b (diff)
downloadchromium_src-6bf9061f137de33b450f5ae9634b8c903bf2326d.zip
chromium_src-6bf9061f137de33b450f5ae9634b8c903bf2326d.tar.gz
chromium_src-6bf9061f137de33b450f5ae9634b8c903bf2326d.tar.bz2
Rename extension_manifest_keys namespace to extensions::manifest_keys.
Move it to extensions/common/manifest_constants.cc. Minorly improve packaged app + manifest version 1 error message. BUG=162530 TBR=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/22794012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217709 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r--chrome/browser/extensions/admin_policy_unittest.cc10
-rw-r--r--chrome/browser/extensions/api/messaging/message_service.cc10
-rw-r--r--chrome/browser/extensions/api/preference/preference_api_prefs_unittest.cc3
-rw-r--r--chrome/browser/extensions/api/spellcheck/spellcheck_api.cc3
-rw-r--r--chrome/browser/extensions/api/storage/managed_value_store_cache.cc7
-rw-r--r--chrome/browser/extensions/component_loader.cc6
-rw-r--r--chrome/browser/extensions/convert_user_script.cc2
-rw-r--r--chrome/browser/extensions/convert_web_app.cc5
-rw-r--r--chrome/browser/extensions/extension_info_map_unittest.cc4
-rw-r--r--chrome/browser/extensions/extension_install_prompt.cc6
-rw-r--r--chrome/browser/extensions/extension_prefs_unittest.cc54
-rw-r--r--chrome/browser/extensions/extension_service_unittest.cc2
-rw-r--r--chrome/browser/extensions/extension_sorting_unittest.cc4
-rw-r--r--chrome/browser/extensions/extension_special_storage_policy_unittest.cc4
-rw-r--r--chrome/browser/extensions/installed_loader.cc9
-rw-r--r--chrome/browser/extensions/sandboxed_unpacker.cc5
-rw-r--r--chrome/browser/extensions/standard_management_policy_provider_unittest.cc6
-rw-r--r--chrome/browser/extensions/test_extension_prefs.cc17
-rw-r--r--chrome/browser/extensions/updater/extension_updater_unittest.cc8
-rw-r--r--chrome/browser/extensions/webstore_installer.cc5
20 files changed, 77 insertions, 93 deletions
diff --git a/chrome/browser/extensions/admin_policy_unittest.cc b/chrome/browser/extensions/admin_policy_unittest.cc
index 4c41f02..b5d3b84 100644
--- a/chrome/browser/extensions/admin_policy_unittest.cc
+++ b/chrome/browser/extensions/admin_policy_unittest.cc
@@ -6,8 +6,8 @@
#include "base/values.h"
#include "chrome/common/extensions/extension.h"
-#include "chrome/common/extensions/extension_manifest_constants.h"
#include "chrome/common/extensions/manifest.h"
+#include "extensions/common/manifest_constants.h"
#include "testing/gtest/include/gtest/gtest.h"
using base::Value;
@@ -25,16 +25,16 @@ class ExtensionAdminPolicyTest : public testing::Test {
void CreateHostedApp(Manifest::Location location) {
base::DictionaryValue values;
- values.Set(extension_manifest_keys::kWebURLs, new base::ListValue());
- values.SetString(extension_manifest_keys::kLaunchWebURL,
+ values.Set(extensions::manifest_keys::kWebURLs, new base::ListValue());
+ values.SetString(extensions::manifest_keys::kLaunchWebURL,
"http://www.example.com");
CreateExtensionFromValues(location, &values);
}
void CreateExtensionFromValues(Manifest::Location location,
base::DictionaryValue* values) {
- values->SetString(extension_manifest_keys::kName, "test");
- values->SetString(extension_manifest_keys::kVersion, "0.1");
+ values->SetString(extensions::manifest_keys::kName, "test");
+ values->SetString(extensions::manifest_keys::kVersion, "0.1");
std::string error;
extension_ = Extension::Create(base::FilePath(), location, *values,
Extension::NO_FLAGS, &error);
diff --git a/chrome/browser/extensions/api/messaging/message_service.cc b/chrome/browser/extensions/api/messaging/message_service.cc
index 00e40f7..be6d2fee 100644
--- a/chrome/browser/extensions/api/messaging/message_service.cc
+++ b/chrome/browser/extensions/api/messaging/message_service.cc
@@ -26,7 +26,6 @@
#include "chrome/browser/tab_contents/tab_util.h"
#include "chrome/common/extensions/background_info.h"
#include "chrome/common/extensions/extension.h"
-#include "chrome/common/extensions/extension_manifest_constants.h"
#include "chrome/common/extensions/extension_messages.h"
#include "chrome/common/extensions/incognito_handler.h"
#include "chrome/common/extensions/manifest_handlers/externally_connectable.h"
@@ -38,6 +37,7 @@
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/site_instance.h"
#include "content/public/browser/web_contents.h"
+#include "extensions/common/manifest_constants.h"
#include "url/gurl.h"
using content::SiteInstance;
@@ -113,7 +113,7 @@ static base::StaticAtomicSequenceNumber g_channel_id_overflow_count;
static content::RenderProcessHost* GetExtensionProcess(
Profile* profile, const std::string& extension_id) {
SiteInstance* site_instance =
- extensions::ExtensionSystem::Get(profile)->process_manager()->
+ ExtensionSystem::Get(profile)->process_manager()->
GetSiteInstanceForURL(
Extension::GetBaseURLFromExtensionId(extension_id));
@@ -206,7 +206,7 @@ void MessageService::OpenChannelToExtension(
}
ExtensionService* extension_service =
- extensions::ExtensionSystem::Get(profile)->extension_service();
+ ExtensionSystem::Get(profile)->extension_service();
if (profile->IsOffTheRecord() &&
!extension_service->IsIncognitoEnabled(target_extension_id)) {
@@ -222,7 +222,7 @@ void MessageService::OpenChannelToExtension(
ExternallyConnectableInfo* externally_connectable =
static_cast<ExternallyConnectableInfo*>(
target_extension->GetManifestData(
- extension_manifest_keys::kExternallyConnectable));
+ manifest_keys::kExternallyConnectable));
bool is_externally_connectable = false;
if (externally_connectable) {
@@ -305,7 +305,7 @@ void MessageService::OpenChannelToNativeApp(
#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
Profile* profile = Profile::FromBrowserContext(source->GetBrowserContext());
ExtensionService* extension_service =
- extensions::ExtensionSystem::Get(profile)->extension_service();
+ ExtensionSystem::Get(profile)->extension_service();
bool has_permission = false;
if (extension_service) {
const Extension* extension =
diff --git a/chrome/browser/extensions/api/preference/preference_api_prefs_unittest.cc b/chrome/browser/extensions/api/preference/preference_api_prefs_unittest.cc
index e187224..00272c8 100644
--- a/chrome/browser/extensions/api/preference/preference_api_prefs_unittest.cc
+++ b/chrome/browser/extensions/api/preference/preference_api_prefs_unittest.cc
@@ -12,15 +12,12 @@
#include "chrome/browser/extensions/extension_prefs.h"
#include "chrome/browser/extensions/extension_prefs_unittest.h"
#include "chrome/common/extensions/extension.h"
-#include "chrome/common/extensions/extension_manifest_constants.h"
#include "chrome/test/base/testing_profile.h"
#include "components/user_prefs/pref_registry_syncable.h"
#include "testing/gtest/include/gtest/gtest.h"
using base::Value;
-namespace keys = extension_manifest_keys;
-
namespace extensions {
namespace {
diff --git a/chrome/browser/extensions/api/spellcheck/spellcheck_api.cc b/chrome/browser/extensions/api/spellcheck/spellcheck_api.cc
index 8c43e53..2c779dc 100644
--- a/chrome/browser/extensions/api/spellcheck/spellcheck_api.cc
+++ b/chrome/browser/extensions/api/spellcheck/spellcheck_api.cc
@@ -15,7 +15,6 @@
namespace extensions {
-namespace keys = extension_manifest_keys;
namespace errors = extension_manifest_errors;
namespace {
@@ -24,7 +23,7 @@ SpellcheckDictionaryInfo* GetSpellcheckDictionaryInfo(
const Extension* extension) {
SpellcheckDictionaryInfo *spellcheck_info =
static_cast<SpellcheckDictionaryInfo*>(
- extension->GetManifestData(keys::kSpellcheck));
+ extension->GetManifestData(manifest_keys::kSpellcheck));
return spellcheck_info;
}
diff --git a/chrome/browser/extensions/api/storage/managed_value_store_cache.cc b/chrome/browser/extensions/api/storage/managed_value_store_cache.cc
index 3b3b15b..4d2453a 100644
--- a/chrome/browser/extensions/api/storage/managed_value_store_cache.cc
+++ b/chrome/browser/extensions/api/storage/managed_value_store_cache.cc
@@ -25,7 +25,6 @@
#include "chrome/browser/value_store/value_store_change.h"
#include "chrome/common/extensions/api/storage/storage_schema_manifest_handler.h"
#include "chrome/common/extensions/extension.h"
-#include "chrome/common/extensions/extension_manifest_constants.h"
#include "chrome/common/extensions/extension_set.h"
#include "chrome/common/extensions/manifest.h"
#include "chrome/common/extensions/permissions/api_permission.h"
@@ -34,6 +33,7 @@
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_source.h"
+#include "extensions/common/manifest_constants.h"
using content::BrowserThread;
@@ -104,8 +104,7 @@ void ManagedValueStoreCache::ExtensionTracker::Observe(
ExtensionSystem::Get(profile_)->extension_service()->extensions();
scoped_ptr<ExtensionSet> managed_extensions(new ExtensionSet());
for (ExtensionSet::const_iterator it = set->begin(); it != set->end(); ++it) {
- if ((*it)->manifest()->HasPath(
- extension_manifest_keys::kStorageManagedSchema)) {
+ if ((*it)->manifest()->HasPath(manifest_keys::kStorageManagedSchema)) {
managed_extensions->Insert(*it);
}
@@ -135,7 +134,7 @@ void ManagedValueStoreCache::ExtensionTracker::LoadSchemas(
it != extensions->end(); ++it) {
std::string schema_file;
if (!(*it)->manifest()->GetString(
- extension_manifest_keys::kStorageManagedSchema, &schema_file)) {
+ manifest_keys::kStorageManagedSchema, &schema_file)) {
// TODO(joaodasilva): Remove this for M30. http://crbug.com/240704
if ((*it)->HasAPIPermission(APIPermission::kStorage)) {
descriptor->RegisterComponent((*it)->id(),
diff --git a/chrome/browser/extensions/component_loader.cc b/chrome/browser/extensions/component_loader.cc
index 769c098..3253450 100644
--- a/chrome/browser/extensions/component_loader.cc
+++ b/chrome/browser/extensions/component_loader.cc
@@ -20,11 +20,11 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_file_util.h"
-#include "chrome/common/extensions/extension_manifest_constants.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
#include "extensions/common/id_util.h"
+#include "extensions/common/manifest_constants.h"
#include "grit/browser_resources.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
@@ -90,7 +90,7 @@ std::string GenerateId(const DictionaryValue* manifest,
const base::FilePath& path) {
std::string raw_key;
std::string id_input;
- CHECK(manifest->GetString(extension_manifest_keys::kPublicKey, &raw_key));
+ CHECK(manifest->GetString(manifest_keys::kPublicKey, &raw_key));
CHECK(Extension::ParsePEMKeyBytes(raw_key, &id_input));
std::string id = id_util::GenerateId(id_input);
return id;
@@ -302,7 +302,7 @@ void ComponentLoader::AddWithName(int manifest_resource_id,
if (manifest) {
// Update manifest to use a proper name.
- manifest->SetString(extension_manifest_keys::kName, name);
+ manifest->SetString(manifest_keys::kName, name);
Add(manifest, root_directory);
}
}
diff --git a/chrome/browser/extensions/convert_user_script.cc b/chrome/browser/extensions/convert_user_script.cc
index 16ab729..4d8b064 100644
--- a/chrome/browser/extensions/convert_user_script.cc
+++ b/chrome/browser/extensions/convert_user_script.cc
@@ -25,7 +25,7 @@
#include "extensions/common/user_script.h"
#include "url/gurl.h"
-namespace keys = extension_manifest_keys;
+namespace keys = extensions::manifest_keys;
namespace values = extension_manifest_values;
namespace extensions {
diff --git a/chrome/browser/extensions/convert_web_app.cc b/chrome/browser/extensions/convert_web_app.cc
index dc3d946..39c905b 100644
--- a/chrome/browser/extensions/convert_web_app.cc
+++ b/chrome/browser/extensions/convert_web_app.cc
@@ -22,17 +22,17 @@
#include "chrome/common/chrome_paths.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_file_util.h"
-#include "chrome/common/extensions/extension_manifest_constants.h"
#include "chrome/common/web_application_info.h"
#include "crypto/sha2.h"
#include "extensions/common/constants.h"
+#include "extensions/common/manifest_constants.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/codec/png_codec.h"
#include "url/gurl.h"
namespace extensions {
-namespace keys = extension_manifest_keys;
+namespace keys = manifest_keys;
using base::Time;
@@ -59,7 +59,6 @@ std::string GenerateKey(const GURL& manifest_url) {
} // namespace
-
// Generates a version for the converted app using the current date. This isn't
// really needed, but it seems like useful information.
std::string ConvertTimeToExtensionVersion(const Time& create_time) {
diff --git a/chrome/browser/extensions/extension_info_map_unittest.cc b/chrome/browser/extensions/extension_info_map_unittest.cc
index 10dace7..9439cf3 100644
--- a/chrome/browser/extensions/extension_info_map_unittest.cc
+++ b/chrome/browser/extensions/extension_info_map_unittest.cc
@@ -8,8 +8,8 @@
#include "chrome/browser/extensions/extension_info_map.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/extensions/extension.h"
-#include "chrome/common/extensions/extension_manifest_constants.h"
#include "content/public/test/test_browser_thread.h"
+#include "extensions/common/manifest_constants.h"
#include "testing/gtest/include/gtest/gtest.h"
using content::BrowserThread;
@@ -17,7 +17,7 @@ using extensions::APIPermission;
using extensions::Extension;
using extensions::Manifest;
-namespace keys = extension_manifest_keys;
+namespace keys = extensions::manifest_keys;
namespace {
diff --git a/chrome/browser/extensions/extension_install_prompt.cc b/chrome/browser/extensions/extension_install_prompt.cc
index 37154bf..4f1363a 100644
--- a/chrome/browser/extensions/extension_install_prompt.cc
+++ b/chrome/browser/extensions/extension_install_prompt.cc
@@ -26,7 +26,6 @@
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/extension_icon_set.h"
-#include "chrome/common/extensions/extension_manifest_constants.h"
#include "chrome/common/extensions/feature_switch.h"
#include "chrome/common/extensions/manifest.h"
#include "chrome/common/extensions/manifest_handlers/icons_handler.h"
@@ -36,6 +35,7 @@
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
#include "extensions/common/extension_resource.h"
+#include "extensions/common/manifest_constants.h"
#include "extensions/common/url_pattern.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -457,11 +457,11 @@ scoped_refptr<Extension>
if (!localized_name.empty() || !localized_description.empty()) {
localized_manifest.reset(manifest->DeepCopy());
if (!localized_name.empty()) {
- localized_manifest->SetString(extension_manifest_keys::kName,
+ localized_manifest->SetString(extensions::manifest_keys::kName,
localized_name);
}
if (!localized_description.empty()) {
- localized_manifest->SetString(extension_manifest_keys::kDescription,
+ localized_manifest->SetString(extensions::manifest_keys::kDescription,
localized_description);
}
}
diff --git a/chrome/browser/extensions/extension_prefs_unittest.cc b/chrome/browser/extensions/extension_prefs_unittest.cc
index eabf8ab..5d5f9c7 100644
--- a/chrome/browser/extensions/extension_prefs_unittest.cc
+++ b/chrome/browser/extensions/extension_prefs_unittest.cc
@@ -18,13 +18,13 @@
#include "chrome/browser/prefs/pref_service_syncable.h"
#include "chrome/browser/prefs/scoped_user_pref_update.h"
#include "chrome/common/chrome_paths.h"
-#include "chrome/common/extensions/extension_manifest_constants.h"
#include "chrome/common/extensions/permissions/permission_set.h"
#include "chrome/common/extensions/permissions/permissions_info.h"
#include "components/user_prefs/pref_registry_syncable.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
#include "content/public/test/mock_notification_observer.h"
+#include "extensions/common/manifest_constants.h"
#include "sync/api/string_ordinal.h"
using base::Time;
@@ -441,9 +441,8 @@ class ExtensionPrefsDelayedInstallInfo : public ExtensionPrefsTest {
// Sets idle install information for one test extension.
void SetIdleInfo(std::string id, int num) {
DictionaryValue manifest;
- manifest.SetString(extension_manifest_keys::kName, "test");
- manifest.SetString(extension_manifest_keys::kVersion,
- "1." + base::IntToString(num));
+ manifest.SetString(manifest_keys::kName, "test");
+ manifest.SetString(manifest_keys::kVersion, "1." + base::IntToString(num));
base::FilePath path =
prefs_.extensions_dir().AppendASCII(base::IntToString(num));
std::string errors;
@@ -470,7 +469,7 @@ class ExtensionPrefsDelayedInstallInfo : public ExtensionPrefsTest {
info->extension_path.BaseName().MaybeAsASCII());
}
- bool HasInfoForId(extensions::ExtensionPrefs::ExtensionsInfo* info,
+ bool HasInfoForId(ExtensionPrefs::ExtensionsInfo* info,
const std::string& id) {
for (size_t i = 0; i < info->size(); ++i) {
if (info->at(i)->extension_id == id)
@@ -492,7 +491,7 @@ class ExtensionPrefsDelayedInstallInfo : public ExtensionPrefsTest {
SetIdleInfo(id2_, 2);
VerifyIdleInfo(id1_, 1);
VerifyIdleInfo(id2_, 2);
- scoped_ptr<extensions::ExtensionPrefs::ExtensionsInfo> info(
+ scoped_ptr<ExtensionPrefs::ExtensionsInfo> info(
prefs()->GetAllDelayedInstallInfo());
EXPECT_EQ(2u, info->size());
EXPECT_TRUE(HasInfoForId(info.get(), id1_));
@@ -524,7 +523,7 @@ class ExtensionPrefsDelayedInstallInfo : public ExtensionPrefsTest {
virtual void Verify() OVERRIDE {
// Make sure the info for the 3 extensions we expect is present.
- scoped_ptr<extensions::ExtensionPrefs::ExtensionsInfo> info(
+ scoped_ptr<ExtensionPrefs::ExtensionsInfo> info(
prefs()->GetAllDelayedInstallInfo());
EXPECT_EQ(3u, info->size());
EXPECT_TRUE(HasInfoForId(info.get(), id1_));
@@ -553,10 +552,9 @@ class ExtensionPrefsFinishDelayedInstallInfo : public ExtensionPrefsTest {
public:
virtual void Initialize() OVERRIDE {
DictionaryValue dictionary;
- dictionary.SetString(extension_manifest_keys::kName, "test");
- dictionary.SetString(extension_manifest_keys::kVersion, "0.1");
- dictionary.SetString(extension_manifest_keys::kBackgroundPage,
- "background.html");
+ dictionary.SetString(manifest_keys::kName, "test");
+ dictionary.SetString(manifest_keys::kVersion, "0.1");
+ dictionary.SetString(manifest_keys::kBackgroundPage, "background.html");
scoped_refptr<Extension> extension =
prefs_.AddExtensionWithManifest(dictionary, Manifest::INTERNAL);
id_ = extension->id();
@@ -564,12 +562,11 @@ class ExtensionPrefsFinishDelayedInstallInfo : public ExtensionPrefsTest {
// Set idle info
DictionaryValue manifest;
- manifest.SetString(extension_manifest_keys::kName, "test");
- manifest.SetString(extension_manifest_keys::kVersion, "0.2");
+ manifest.SetString(manifest_keys::kName, "test");
+ manifest.SetString(manifest_keys::kVersion, "0.2");
scoped_ptr<ListValue> scripts(new ListValue);
scripts->AppendString("test.js");
- manifest.Set(extension_manifest_keys::kBackgroundScripts,
- scripts.release());
+ manifest.Set(manifest_keys::kBackgroundScripts, scripts.release());
base::FilePath path =
prefs_.extensions_dir().AppendASCII("test_0.2");
std::string errors;
@@ -594,15 +591,13 @@ class ExtensionPrefsFinishDelayedInstallInfo : public ExtensionPrefsTest {
ASSERT_TRUE(prefs()->ReadPrefAsDictionary(id_, "manifest", &manifest));
ASSERT_TRUE(manifest);
std::string value;
- EXPECT_TRUE(manifest->GetString(extension_manifest_keys::kName, &value));
+ EXPECT_TRUE(manifest->GetString(manifest_keys::kName, &value));
EXPECT_EQ("test", value);
- EXPECT_TRUE(manifest->GetString(extension_manifest_keys::kVersion, &value));
+ EXPECT_TRUE(manifest->GetString(manifest_keys::kVersion, &value));
EXPECT_EQ("0.2", value);
- EXPECT_FALSE(manifest->GetString(extension_manifest_keys::kBackgroundPage,
- &value));
+ EXPECT_FALSE(manifest->GetString(manifest_keys::kBackgroundPage, &value));
const ListValue* scripts;
- ASSERT_TRUE(manifest->GetList(extension_manifest_keys::kBackgroundScripts,
- &scripts));
+ ASSERT_TRUE(manifest->GetList(manifest_keys::kBackgroundScripts, &scripts));
EXPECT_EQ(1u, scripts->GetSize());
}
@@ -663,25 +658,24 @@ class ExtensionPrefsFlags : public ExtensionPrefsTest {
virtual void Initialize() OVERRIDE {
{
base::DictionaryValue dictionary;
- dictionary.SetString(extension_manifest_keys::kName, "from_webstore");
- dictionary.SetString(extension_manifest_keys::kVersion, "0.1");
+ dictionary.SetString(manifest_keys::kName, "from_webstore");
+ dictionary.SetString(manifest_keys::kVersion, "0.1");
webstore_extension_ = prefs_.AddExtensionWithManifestAndFlags(
dictionary, Manifest::INTERNAL, Extension::FROM_WEBSTORE);
}
{
base::DictionaryValue dictionary;
- dictionary.SetString(extension_manifest_keys::kName, "from_bookmark");
- dictionary.SetString(extension_manifest_keys::kVersion, "0.1");
+ dictionary.SetString(manifest_keys::kName, "from_bookmark");
+ dictionary.SetString(manifest_keys::kVersion, "0.1");
bookmark_extension_ = prefs_.AddExtensionWithManifestAndFlags(
dictionary, Manifest::INTERNAL, Extension::FROM_BOOKMARK);
}
{
base::DictionaryValue dictionary;
- dictionary.SetString(extension_manifest_keys::kName,
- "was_installed_by_default");
- dictionary.SetString(extension_manifest_keys::kVersion, "0.1");
+ dictionary.SetString(manifest_keys::kName, "was_installed_by_default");
+ dictionary.SetString(manifest_keys::kVersion, "0.1");
default_extension_ = prefs_.AddExtensionWithManifestAndFlags(
dictionary,
Manifest::INTERNAL,
@@ -711,8 +705,8 @@ PrefsPrepopulatedTestBase::PrefsPrepopulatedTestBase()
DictionaryValue simple_dict;
std::string error;
- simple_dict.SetString(extension_manifest_keys::kVersion, "1.0.0.0");
- simple_dict.SetString(extension_manifest_keys::kName, "unused");
+ simple_dict.SetString(manifest_keys::kVersion, "1.0.0.0");
+ simple_dict.SetString(manifest_keys::kName, "unused");
extension1_ = Extension::Create(
prefs_.temp_dir().AppendASCII("ext1_"),
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc
index a205c1b..c0ebbc5 100644
--- a/chrome/browser/extensions/extension_service_unittest.cc
+++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -145,7 +145,7 @@ using extensions::PermissionSet;
using extensions::TestExtensionSystem;
using extensions::URLPatternSet;
-namespace keys = extension_manifest_keys;
+namespace keys = extensions::manifest_keys;
namespace {
diff --git a/chrome/browser/extensions/extension_sorting_unittest.cc b/chrome/browser/extensions/extension_sorting_unittest.cc
index 6a51402..295ff6a 100644
--- a/chrome/browser/extensions/extension_sorting_unittest.cc
+++ b/chrome/browser/extensions/extension_sorting_unittest.cc
@@ -7,7 +7,7 @@
#include <map>
#include "chrome/browser/extensions/extension_prefs_unittest.h"
-#include "chrome/common/extensions/extension_manifest_constants.h"
+#include "extensions/common/manifest_constants.h"
#include "sync/api/string_ordinal.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -15,7 +15,7 @@ using extensions::Blacklist;
using extensions::Extension;
using extensions::Manifest;
-namespace keys = extension_manifest_keys;
+namespace keys = extensions::manifest_keys;
class ExtensionSortingTest : public extensions::ExtensionPrefsTest {
protected:
diff --git a/chrome/browser/extensions/extension_special_storage_policy_unittest.cc b/chrome/browser/extensions/extension_special_storage_policy_unittest.cc
index a849f2a..4141353 100644
--- a/chrome/browser/extensions/extension_special_storage_policy_unittest.cc
+++ b/chrome/browser/extensions/extension_special_storage_policy_unittest.cc
@@ -9,10 +9,10 @@
#include "chrome/common/content_settings.h"
#include "chrome/common/content_settings_types.h"
#include "chrome/common/extensions/extension.h"
-#include "chrome/common/extensions/extension_manifest_constants.h"
#include "chrome/common/extensions/manifest.h"
#include "chrome/test/base/testing_profile.h"
#include "content/public/test/test_browser_thread.h"
+#include "extensions/common/manifest_constants.h"
#include "testing/gtest/include/gtest/gtest.h"
using content::BrowserThread;
@@ -22,7 +22,7 @@ using quota::SpecialStoragePolicy;
typedef SpecialStoragePolicy::StoragePolicy StoragePolicy;
-namespace keys = extension_manifest_keys;
+namespace keys = extensions::manifest_keys;
class ExtensionSpecialStoragePolicyTest : public testing::Test {
protected:
diff --git a/chrome/browser/extensions/installed_loader.cc b/chrome/browser/extensions/installed_loader.cc
index 62940e1..8927c45 100644
--- a/chrome/browser/extensions/installed_loader.cc
+++ b/chrome/browser/extensions/installed_loader.cc
@@ -75,7 +75,8 @@ enum ExternalItemState {
};
bool IsManifestCorrupt(const DictionaryValue* manifest) {
- if (!manifest) return false;
+ if (!manifest)
+ return false;
// Because of bug #272524 sometimes manifests got mangled in the preferences
// file, one particularly bad case resulting in having both a background page
@@ -83,10 +84,8 @@ bool IsManifestCorrupt(const DictionaryValue* manifest) {
// manifest from the extension to fix this.
const Value* background_page;
const Value* background_scripts;
- return manifest->Get(extension_manifest_keys::kBackgroundPage,
- &background_page) &&
- manifest->Get(extension_manifest_keys::kBackgroundScripts,
- &background_scripts);
+ return manifest->Get(manifest_keys::kBackgroundPage, &background_page) &&
+ manifest->Get(manifest_keys::kBackgroundScripts, &background_scripts);
}
ManifestReloadReason ShouldReloadExtensionManifest(const ExtensionInfo& info) {
diff --git a/chrome/browser/extensions/sandboxed_unpacker.cc b/chrome/browser/extensions/sandboxed_unpacker.cc
index 30d6c94..1a98850 100644
--- a/chrome/browser/extensions/sandboxed_unpacker.cc
+++ b/chrome/browser/extensions/sandboxed_unpacker.cc
@@ -26,8 +26,6 @@
#include "chrome/common/extensions/extension.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"
-#include "chrome/common/extensions/extension_manifest_constants.h"
#include "chrome/common/extensions/manifest_handlers/icons_handler.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/utility_process_host.h"
@@ -36,6 +34,7 @@
#include "extensions/common/constants.h"
#include "extensions/common/crx_file.h"
#include "extensions/common/id_util.h"
+#include "extensions/common/manifest_constants.h"
#include "grit/generated_resources.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/l10n/l10n_util.h"
@@ -607,7 +606,7 @@ DictionaryValue* SandboxedUnpacker::RewriteManifestFile(
// the original manifest. We do this to ensure the manifest doesn't contain an
// exploitable bug that could be used to compromise the browser.
scoped_ptr<DictionaryValue> final_manifest(manifest.DeepCopy());
- final_manifest->SetString(extension_manifest_keys::kPublicKey, public_key_);
+ final_manifest->SetString(manifest_keys::kPublicKey, public_key_);
std::string manifest_json;
JSONStringValueSerializer serializer(&manifest_json);
diff --git a/chrome/browser/extensions/standard_management_policy_provider_unittest.cc b/chrome/browser/extensions/standard_management_policy_provider_unittest.cc
index ae6f6e5e..862f95a 100644
--- a/chrome/browser/extensions/standard_management_policy_provider_unittest.cc
+++ b/chrome/browser/extensions/standard_management_policy_provider_unittest.cc
@@ -9,8 +9,8 @@
#include "chrome/browser/extensions/extension_prefs.h"
#include "chrome/browser/extensions/standard_management_policy_provider.h"
#include "chrome/browser/extensions/test_extension_prefs.h"
-#include "chrome/common/extensions/extension_manifest_constants.h"
#include "content/public/test/test_browser_thread.h"
+#include "extensions/common/manifest_constants.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace extensions {
@@ -31,8 +31,8 @@ class StandardManagementPolicyProviderTest : public testing::Test {
scoped_refptr<const Extension> CreateExtension(Manifest::Location location,
bool required) {
base::DictionaryValue values;
- values.SetString(extension_manifest_keys::kName, "test");
- values.SetString(extension_manifest_keys::kVersion, "0.1");
+ values.SetString(manifest_keys::kName, "test");
+ values.SetString(manifest_keys::kVersion, "0.1");
std::string error;
scoped_refptr<const Extension> extension = Extension::Create(
base::FilePath(), location, values, Extension::NO_FLAGS, &error);
diff --git a/chrome/browser/extensions/test_extension_prefs.cc b/chrome/browser/extensions/test_extension_prefs.cc
index 018ff42..c53f136 100644
--- a/chrome/browser/extensions/test_extension_prefs.cc
+++ b/chrome/browser/extensions/test_extension_prefs.cc
@@ -22,9 +22,9 @@
#include "chrome/browser/prefs/pref_service_mock_builder.h"
#include "chrome/browser/prefs/pref_service_syncable.h"
#include "chrome/common/extensions/extension.h"
-#include "chrome/common/extensions/extension_manifest_constants.h"
#include "components/user_prefs/pref_registry_syncable.h"
#include "content/public/browser/browser_thread.h"
+#include "extensions/common/manifest_constants.h"
#include "sync/api/string_ordinal.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -122,18 +122,17 @@ void TestExtensionPrefs::RecreateExtensionPrefs() {
scoped_refptr<Extension> TestExtensionPrefs::AddExtension(std::string name) {
DictionaryValue dictionary;
- dictionary.SetString(extension_manifest_keys::kName, name);
- dictionary.SetString(extension_manifest_keys::kVersion, "0.1");
+ dictionary.SetString(manifest_keys::kName, name);
+ dictionary.SetString(manifest_keys::kVersion, "0.1");
return AddExtensionWithManifest(dictionary, Manifest::INTERNAL);
}
scoped_refptr<Extension> TestExtensionPrefs::AddApp(std::string name) {
DictionaryValue dictionary;
- dictionary.SetString(extension_manifest_keys::kName, name);
- dictionary.SetString(extension_manifest_keys::kVersion, "0.1");
- dictionary.SetString(extension_manifest_keys::kApp, "true");
- dictionary.SetString(extension_manifest_keys::kLaunchWebURL,
- "http://example.com");
+ dictionary.SetString(manifest_keys::kName, name);
+ dictionary.SetString(manifest_keys::kVersion, "0.1");
+ dictionary.SetString(manifest_keys::kApp, "true");
+ dictionary.SetString(manifest_keys::kLaunchWebURL, "http://example.com");
return AddExtensionWithManifest(dictionary, Manifest::INTERNAL);
}
@@ -149,7 +148,7 @@ scoped_refptr<Extension> TestExtensionPrefs::AddExtensionWithManifestAndFlags(
Manifest::Location location,
int extra_flags) {
std::string name;
- EXPECT_TRUE(manifest.GetString(extension_manifest_keys::kName, &name));
+ EXPECT_TRUE(manifest.GetString(manifest_keys::kName, &name));
base::FilePath path = extensions_dir_.AppendASCII(name);
std::string errors;
scoped_refptr<Extension> extension = Extension::Create(
diff --git a/chrome/browser/extensions/updater/extension_updater_unittest.cc b/chrome/browser/extensions/updater/extension_updater_unittest.cc
index 8b8cb2d..7fc96f4 100644
--- a/chrome/browser/extensions/updater/extension_updater_unittest.cc
+++ b/chrome/browser/extensions/updater/extension_updater_unittest.cc
@@ -41,7 +41,6 @@
#include "chrome/browser/google/google_util.h"
#include "chrome/browser/prefs/pref_service_syncable.h"
#include "chrome/common/extensions/extension.h"
-#include "chrome/common/extensions/extension_manifest_constants.h"
#include "chrome/common/omaha_query_params/omaha_query_params.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/testing_profile.h"
@@ -54,6 +53,7 @@
#include "content/public/test/test_browser_thread_bundle.h"
#include "content/public/test/test_utils.h"
#include "extensions/common/id_util.h"
+#include "extensions/common/manifest_constants.h"
#include "libxml/globals.h"
#include "net/base/backoff_entry.h"
#include "net/base/escape.h"
@@ -271,12 +271,12 @@ class MockService : public TestExtensionService {
Manifest::Location location) {
for (int i = 1; i <= count; i++) {
DictionaryValue manifest;
- manifest.SetString(extension_manifest_keys::kVersion,
+ manifest.SetString(manifest_keys::kVersion,
base::StringPrintf("%d.0.0.0", i));
- manifest.SetString(extension_manifest_keys::kName,
+ manifest.SetString(manifest_keys::kName,
base::StringPrintf("Extension %d.%d", id, i));
if (update_url)
- manifest.SetString(extension_manifest_keys::kUpdateURL, *update_url);
+ manifest.SetString(manifest_keys::kUpdateURL, *update_url);
scoped_refptr<Extension> e =
prefs_->AddExtensionWithManifest(manifest, location);
ASSERT_TRUE(e.get() != NULL);
diff --git a/chrome/browser/extensions/webstore_installer.cc b/chrome/browser/extensions/webstore_installer.cc
index f9bced0..651a28d 100644
--- a/chrome/browser/extensions/webstore_installer.cc
+++ b/chrome/browser/extensions/webstore_installer.cc
@@ -28,7 +28,6 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
-#include "chrome/common/extensions/extension_manifest_constants.h"
#include "chrome/common/omaha_query_params/omaha_query_params.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/download_manager.h"
@@ -42,6 +41,7 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
+#include "extensions/common/manifest_constants.h"
#include "net/base/escape.h"
#include "url/gurl.h"
@@ -238,8 +238,7 @@ void WebstoreInstaller::Start() {
base::Bind(&WebstoreInstaller::StartDownload, this)));
std::string name;
- if (!approval_->manifest->value()->GetString(extension_manifest_keys::kName,
- &name)) {
+ if (!approval_->manifest->value()->GetString(manifest_keys::kName, &name)) {
NOTREACHED();
}
extensions::InstallTracker* tracker =