diff options
100 files changed, 575 insertions, 572 deletions
diff --git a/chrome/browser/background/background_application_list_model_unittest.cc b/chrome/browser/background/background_application_list_model_unittest.cc index 0858e73..2e410c0 100644 --- a/chrome/browser/background/background_application_list_model_unittest.cc +++ b/chrome/browser/background/background_application_list_model_unittest.cc @@ -19,12 +19,12 @@ #include "chrome/browser/extensions/extension_system.h" #include "chrome/browser/extensions/permissions_updater.h" #include "chrome/common/extensions/extension.h" -#include "chrome/common/extensions/extension_manifest_constants.h" #include "chrome/common/extensions/permissions/api_permission.h" #include "chrome/common/extensions/permissions/permission_set.h" #include "chrome/test/base/testing_profile.h" #include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_types.h" +#include "extensions/common/manifest_constants.h" #include "testing/gtest/include/gtest/gtest.h" // This value is used to seed the PRNG at the beginning of a sequence of @@ -62,11 +62,11 @@ class BackgroundApplicationListModelTest : public ExtensionServiceTestBase { static scoped_refptr<Extension> CreateExtension(const std::string& name, bool background_permission) { DictionaryValue manifest; - manifest.SetString(extension_manifest_keys::kVersion, "1.0.0.0"); - manifest.SetString(extension_manifest_keys::kName, name); + manifest.SetString(extensions::manifest_keys::kVersion, "1.0.0.0"); + manifest.SetString(extensions::manifest_keys::kName, name); if (background_permission) { ListValue* permissions = new ListValue(); - manifest.Set(extension_manifest_keys::kPermissions, permissions); + manifest.Set(extensions::manifest_keys::kPermissions, permissions); permissions->Append(Value::CreateStringValue("background")); } std::string error; diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_data.cc b/chrome/browser/chromeos/app_mode/kiosk_app_data.cc index 524c98b..9c00e9e 100644 --- a/chrome/browser/chromeos/app_mode/kiosk_app_data.cc +++ b/chrome/browser/chromeos/app_mode/kiosk_app_data.cc @@ -20,9 +20,9 @@ #include "chrome/browser/image_decoder.h" #include "chrome/browser/prefs/scoped_user_pref_update.h" #include "chrome/common/extensions/extension_constants.h" -#include "chrome/common/extensions/extension_manifest_constants.h" #include "chrome/common/extensions/manifest.h" #include "content/public/browser/browser_thread.h" +#include "extensions/common/manifest_constants.h" #include "ui/gfx/codec/png_codec.h" using content::BrowserThread; @@ -63,7 +63,7 @@ void SaveIconToLocalOnBlockingPool( // Returns true for valid kiosk app manifest. bool IsValidKioskAppManifest(const extensions::Manifest& manifest) { bool kiosk_enabled; - if (manifest.GetBoolean(extension_manifest_keys::kKioskEnabled, + if (manifest.GetBoolean(extensions::manifest_keys::kKioskEnabled, &kiosk_enabled)) { return kiosk_enabled; } diff --git a/chrome/browser/chromeos/input_method/component_extension_ime_manager_impl.cc b/chrome/browser/chromeos/input_method/component_extension_ime_manager_impl.cc index 376b90a..2a61f89 100644 --- a/chrome/browser/chromeos/input_method/component_extension_ime_manager_impl.cc +++ b/chrome/browser/chromeos/input_method/component_extension_ime_manager_impl.cc @@ -14,8 +14,8 @@ #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 "content/public/browser/browser_thread.h" +#include "extensions/common/manifest_constants.h" #include "ui/base/l10n/l10n_util.h" namespace chromeos { @@ -177,18 +177,18 @@ bool ComponentExtensionIMEManagerImpl::ReadEngineComponent( DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); DCHECK(out); std::string type; - if (!dict.GetString(extension_manifest_keys::kType, &type)) + if (!dict.GetString(extensions::manifest_keys::kType, &type)) return false; if (type != "ime") return false; - if (!dict.GetString(extension_manifest_keys::kId, &out->engine_id)) + if (!dict.GetString(extensions::manifest_keys::kId, &out->engine_id)) return false; - if (!dict.GetString(extension_manifest_keys::kName, &out->display_name)) + if (!dict.GetString(extensions::manifest_keys::kName, &out->display_name)) return false; std::set<std::string> languages; const base::Value* language_value = NULL; - if (dict.Get(extension_manifest_keys::kLanguage, &language_value)) { + if (dict.Get(extensions::manifest_keys::kLanguage, &language_value)) { if (language_value->GetType() == base::Value::TYPE_STRING) { std::string language_str; language_value->GetAsString(&language_str); @@ -207,7 +207,7 @@ bool ComponentExtensionIMEManagerImpl::ReadEngineComponent( out->language_codes.assign(languages.begin(), languages.end()); const ListValue* layouts = NULL; - if (!dict.GetList(extension_manifest_keys::kLayouts, &layouts)) + if (!dict.GetList(extensions::manifest_keys::kLayouts, &layouts)) return false; for (size_t i = 0; i < layouts->GetSize(); ++i) { @@ -224,11 +224,11 @@ bool ComponentExtensionIMEManagerImpl::ReadExtensionInfo( const std::string& extension_id, ComponentExtensionIME* out) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); - if (!manifest.GetString(extension_manifest_keys::kDescription, + if (!manifest.GetString(extensions::manifest_keys::kDescription, &out->description)) return false; std::string url_string; - if (!manifest.GetString(extension_manifest_keys::kOptionsPage, &url_string)) + if (!manifest.GetString(extensions::manifest_keys::kOptionsPage, &url_string)) return true; // It's okay to return true on no option page case. GURL url = extensions::Extension::GetResourceURL( @@ -271,7 +271,7 @@ void ComponentExtensionIMEManagerImpl::ReadComponentExtensionsInfo( component_ime.id = whitelisted_component_extension[i].id; const ListValue* component_list; - if (!manifest->GetList(extension_manifest_keys::kInputComponents, + if (!manifest->GetList(extensions::manifest_keys::kInputComponents, &component_list)) continue; 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 = diff --git a/chrome/browser/media_galleries/media_galleries_test_util.cc b/chrome/browser/media_galleries/media_galleries_test_util.cc index 0f01e1e..c2a510d 100644 --- a/chrome/browser/media_galleries/media_galleries_test_util.cc +++ b/chrome/browser/media_galleries/media_galleries_test_util.cc @@ -15,7 +15,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/extensions/extension.h" -#include "chrome/common/extensions/extension_manifest_constants.h" +#include "extensions/common/manifest_constants.h" #include "testing/gtest/include/gtest/gtest.h" namespace chrome { @@ -25,12 +25,12 @@ scoped_refptr<extensions::Extension> AddMediaGalleriesApp( const std::vector<std::string>& media_galleries_permissions, Profile* profile) { scoped_ptr<DictionaryValue> manifest(new DictionaryValue); - manifest->SetString(extension_manifest_keys::kName, name); - manifest->SetString(extension_manifest_keys::kVersion, "0.1"); - manifest->SetInteger(extension_manifest_keys::kManifestVersion, 2); + manifest->SetString(extensions::manifest_keys::kName, name); + manifest->SetString(extensions::manifest_keys::kVersion, "0.1"); + manifest->SetInteger(extensions::manifest_keys::kManifestVersion, 2); ListValue* background_script_list = new ListValue; background_script_list->Append(Value::CreateStringValue("background.js")); - manifest->Set(extension_manifest_keys::kPlatformAppBackgroundScripts, + manifest->Set(extensions::manifest_keys::kPlatformAppBackgroundScripts, background_script_list); ListValue* permission_detail_list = new ListValue; @@ -41,7 +41,7 @@ scoped_refptr<extensions::Extension> AddMediaGalleriesApp( media_galleries_permission->Set("mediaGalleries", permission_detail_list); ListValue* permission_list = new ListValue; permission_list->Append(media_galleries_permission); - manifest->Set(extension_manifest_keys::kPermissions, permission_list); + manifest->Set(extensions::manifest_keys::kPermissions, permission_list); extensions::ExtensionPrefs* extension_prefs = extensions::ExtensionPrefs::Get(profile); diff --git a/chrome/browser/profile_resetter/profile_resetter_unittest.cc b/chrome/browser/profile_resetter/profile_resetter_unittest.cc index e561288..34b6110 100644 --- a/chrome/browser/profile_resetter/profile_resetter_unittest.cc +++ b/chrome/browser/profile_resetter/profile_resetter_unittest.cc @@ -22,11 +22,11 @@ #include "chrome/browser/themes/theme_service_factory.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/common/extensions/extension.h" -#include "chrome/common/extensions/extension_manifest_constants.h" #include "chrome/common/pref_names.h" #include "chrome/test/base/browser_with_test_window_test.h" #include "content/public/browser/web_contents.h" #include "content/public/test/test_browser_thread.h" +#include "extensions/common/manifest_constants.h" #include "net/http/http_response_headers.h" #include "net/url_request/test_url_fetcher_factory.h" @@ -232,16 +232,16 @@ scoped_refptr<Extension> CreateExtension(const std::string& name, extensions::Manifest::Type type, bool installed_by_default) { DictionaryValue manifest; - manifest.SetString(extension_manifest_keys::kVersion, "1.0.0.0"); - manifest.SetString(extension_manifest_keys::kName, name); + manifest.SetString(extensions::manifest_keys::kVersion, "1.0.0.0"); + manifest.SetString(extensions::manifest_keys::kName, name); switch (type) { case extensions::Manifest::TYPE_THEME: - manifest.Set(extension_manifest_keys::kTheme, new DictionaryValue); + manifest.Set(extensions::manifest_keys::kTheme, new DictionaryValue); break; case extensions::Manifest::TYPE_HOSTED_APP: - manifest.SetString(extension_manifest_keys::kLaunchWebURL, + manifest.SetString(extensions::manifest_keys::kLaunchWebURL, "http://www.google.com"); - manifest.SetString(extension_manifest_keys::kUpdateURL, + manifest.SetString(extensions::manifest_keys::kUpdateURL, "http://clients2.google.com/service/update2/crx"); break; case extensions::Manifest::TYPE_EXTENSION: @@ -250,7 +250,7 @@ scoped_refptr<Extension> CreateExtension(const std::string& name, default: NOTREACHED(); } - manifest.SetString(extension_manifest_keys::kOmniboxKeyword, name); + manifest.SetString(extensions::manifest_keys::kOmniboxKeyword, name); std::string error; scoped_refptr<Extension> extension = Extension::Create( path, diff --git a/chrome/browser/search_engines/template_url_service_unittest.cc b/chrome/browser/search_engines/template_url_service_unittest.cc index 42cd071..15ff76ae 100644 --- a/chrome/browser/search_engines/template_url_service_unittest.cc +++ b/chrome/browser/search_engines/template_url_service_unittest.cc @@ -26,12 +26,12 @@ #include "chrome/browser/search_engines/template_url_service_test_util.h" #include "chrome/browser/webdata/web_data_service_factory.h" #include "chrome/common/extensions/extension.h" -#include "chrome/common/extensions/extension_manifest_constants.h" #include "chrome/common/url_constants.h" #include "chrome/test/base/testing_profile.h" #include "components/webdata/common/web_database.h" #include "content/public/test/test_browser_thread.h" #include "extensions/common/constants.h" +#include "extensions/common/manifest_constants.h" #include "testing/gtest/include/gtest/gtest.h" using base::Time; @@ -953,10 +953,10 @@ TEST_F(TemplateURLServiceExtensionTest, ResetURLs) { TemplateURLPrepopulateData::GetEngineType(default_provider->url())); DictionaryValue manifest; - manifest.SetString(extension_manifest_keys::kVersion, "1.0.0.0"); - manifest.SetString(extension_manifest_keys::kName, "ext1"); + manifest.SetString(extensions::manifest_keys::kVersion, "1.0.0.0"); + manifest.SetString(extensions::manifest_keys::kName, "ext1"); manifest.SetString("app.launch.web_url", "http://www.google.com"); - manifest.SetString(extension_manifest_keys::kOmniboxKeyword, "ext_keyword"); + manifest.SetString(extensions::manifest_keys::kOmniboxKeyword, "ext_keyword"); std::string error; scoped_refptr<extensions::Extension> extension = extensions::Extension::Create( diff --git a/chrome/browser/sync/glue/extensions_activity_monitor_unittest.cc b/chrome/browser/sync/glue/extensions_activity_monitor_unittest.cc index bfeeb21..3f17c4b 100644 --- a/chrome/browser/sync/glue/extensions_activity_monitor_unittest.cc +++ b/chrome/browser/sync/glue/extensions_activity_monitor_unittest.cc @@ -12,9 +12,9 @@ #include "chrome/browser/extensions/api/bookmarks/bookmarks_api.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/extensions/extension.h" -#include "chrome/common/extensions/extension_manifest_constants.h" #include "content/public/browser/notification_service.h" #include "content/public/test/test_browser_thread.h" +#include "extensions/common/manifest_constants.h" #include "sync/util/extensions_activity.h" #include "testing/gtest/include/gtest/gtest.h" @@ -25,7 +25,7 @@ namespace browser_sync { namespace { using content::BrowserThread; -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; // Create and return an extension with the given path. scoped_refptr<Extension> MakeExtension(const std::string& name) { diff --git a/chrome/browser/sync/test/integration/sync_extension_helper.cc b/chrome/browser/sync/test/integration/sync_extension_helper.cc index fba06cd..393f943 100644 --- a/chrome/browser/sync/test/integration/sync_extension_helper.cc +++ b/chrome/browser/sync/test/integration/sync_extension_helper.cc @@ -16,8 +16,8 @@ #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" #include "chrome/browser/sync/test/integration/sync_test.h" #include "chrome/common/extensions/extension.h" -#include "chrome/common/extensions/extension_manifest_constants.h" #include "extensions/common/id_util.h" +#include "extensions/common/manifest_constants.h" #include "sync/api/string_ordinal.h" #include "testing/gtest/include/gtest/gtest.h" @@ -273,30 +273,30 @@ scoped_refptr<Extension> CreateExtension(const base::FilePath& base_dir, const std::string& name, Manifest::Type type) { DictionaryValue source; - source.SetString(extension_manifest_keys::kName, name); + source.SetString(extensions::manifest_keys::kName, name); const std::string& public_key = NameToPublicKey(name); - source.SetString(extension_manifest_keys::kPublicKey, public_key); - source.SetString(extension_manifest_keys::kVersion, "0.0.0.0"); + source.SetString(extensions::manifest_keys::kPublicKey, public_key); + source.SetString(extensions::manifest_keys::kVersion, "0.0.0.0"); switch (type) { case Manifest::TYPE_EXTENSION: // Do nothing. break; case Manifest::TYPE_THEME: - source.Set(extension_manifest_keys::kTheme, new DictionaryValue()); + source.Set(extensions::manifest_keys::kTheme, new DictionaryValue()); break; case Manifest::TYPE_HOSTED_APP: case Manifest::TYPE_LEGACY_PACKAGED_APP: - source.Set(extension_manifest_keys::kApp, new DictionaryValue()); - source.SetString(extension_manifest_keys::kLaunchWebURL, + source.Set(extensions::manifest_keys::kApp, new DictionaryValue()); + source.SetString(extensions::manifest_keys::kLaunchWebURL, "http://www.example.com"); break; case Manifest::TYPE_PLATFORM_APP: { - source.Set(extension_manifest_keys::kApp, new DictionaryValue()); - source.Set(extension_manifest_keys::kPlatformAppBackground, + source.Set(extensions::manifest_keys::kApp, new DictionaryValue()); + source.Set(extensions::manifest_keys::kPlatformAppBackground, new DictionaryValue()); ListValue* scripts = new ListValue(); scripts->AppendString("main.js"); - source.Set(extension_manifest_keys::kPlatformAppBackgroundScripts, + source.Set(extensions::manifest_keys::kPlatformAppBackgroundScripts, scripts); break; } diff --git a/chrome/browser/themes/theme_service_unittest.cc b/chrome/browser/themes/theme_service_unittest.cc index a9acc9a..ff45d0e 100644 --- a/chrome/browser/themes/theme_service_unittest.cc +++ b/chrome/browser/themes/theme_service_unittest.cc @@ -15,7 +15,6 @@ #include "chrome/browser/themes/theme_service_factory.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/extensions/extension.h" -#include "chrome/common/extensions/extension_manifest_constants.h" #include "chrome/common/pref_names.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" diff --git a/chrome/browser/themes/theme_syncable_service_unittest.cc b/chrome/browser/themes/theme_syncable_service_unittest.cc index bf91861..e5f9eb0 100644 --- a/chrome/browser/themes/theme_syncable_service_unittest.cc +++ b/chrome/browser/themes/theme_syncable_service_unittest.cc @@ -15,13 +15,13 @@ #include "chrome/browser/themes/theme_service.h" #include "chrome/browser/themes/theme_service_factory.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/manifest_url_handler.h" #include "chrome/common/extensions/permissions/api_permission_set.h" #include "chrome/common/extensions/permissions/permission_set.h" #include "chrome/test/base/testing_profile.h" #include "content/public/test/test_browser_thread.h" +#include "extensions/common/manifest_constants.h" #include "sync/api/sync_error.h" #include "sync/api/sync_error_factory_mock.h" #include "sync/protocol/sync.pb.h" @@ -144,10 +144,10 @@ scoped_refptr<extensions::Extension> MakeThemeExtension( extensions::Manifest::Location location, const string& update_url) { DictionaryValue source; - source.SetString(extension_manifest_keys::kName, name); - source.Set(extension_manifest_keys::kTheme, new DictionaryValue()); - source.SetString(extension_manifest_keys::kUpdateURL, update_url); - source.SetString(extension_manifest_keys::kVersion, "0.0.0.0"); + source.SetString(extensions::manifest_keys::kName, name); + source.Set(extensions::manifest_keys::kTheme, new DictionaryValue()); + source.SetString(extensions::manifest_keys::kUpdateURL, update_url); + source.SetString(extensions::manifest_keys::kVersion, "0.0.0.0"); string error; scoped_refptr<extensions::Extension> extension = extensions::Extension::Create( diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_unittest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_unittest.cc index 8643cc1..d18f661 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_unittest.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_unittest.cc @@ -30,12 +30,12 @@ #include "chrome/browser/ui/tabs/tab_strip_model.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/pref_names.h" #include "chrome/test/base/browser_with_test_window_test.h" #include "chrome/test/base/testing_pref_service_syncable.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" #include "ui/base/models/menu_model.h" @@ -154,10 +154,10 @@ class ChromeLauncherControllerPerAppTest : public BrowserWithTestWindowTest { model_->AddObserver(model_observer_.get()); DictionaryValue manifest; - manifest.SetString(extension_manifest_keys::kName, + manifest.SetString(extensions::manifest_keys::kName, "launcher controller test extension"); - manifest.SetString(extension_manifest_keys::kVersion, "1"); - manifest.SetString(extension_manifest_keys::kDescription, + manifest.SetString(extensions::manifest_keys::kVersion, "1"); + manifest.SetString(extensions::manifest_keys::kDescription, "for testing pinned apps"); extensions::TestExtensionSystem* extension_system( @@ -179,16 +179,16 @@ class ChromeLauncherControllerPerAppTest : public BrowserWithTestWindowTest { &error); // Fake gmail extension. DictionaryValue manifest_gmail; - manifest_gmail.SetString(extension_manifest_keys::kName, + manifest_gmail.SetString(extensions::manifest_keys::kName, "Gmail launcher controller test extension"); - manifest_gmail.SetString(extension_manifest_keys::kVersion, "1"); - manifest_gmail.SetString(extension_manifest_keys::kDescription, + manifest_gmail.SetString(extensions::manifest_keys::kVersion, "1"); + manifest_gmail.SetString(extensions::manifest_keys::kDescription, "for testing pinned Gmail"); - manifest_gmail.SetString(extension_manifest_keys::kLaunchWebURL, + manifest_gmail.SetString(extensions::manifest_keys::kLaunchWebURL, "https://mail.google.com/mail/ca"); ListValue* list = new ListValue(); list->Append(Value::CreateStringValue("*://mail.google.com/mail/ca")); - manifest_gmail.Set(extension_manifest_keys::kWebURLs, list); + manifest_gmail.Set(extensions::manifest_keys::kWebURLs, list); extension3_ = Extension::Create(base::FilePath(), Manifest::UNPACKED, manifest_gmail, diff --git a/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller_unittest.mm b/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller_unittest.mm index 4016bbd..8b87ef3 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller_unittest.mm @@ -19,7 +19,7 @@ #import "chrome/browser/ui/cocoa/info_bubble_window.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/extensions/extension.h" -#include "chrome/common/extensions/extension_manifest_constants.h" +#include "extensions/common/manifest_constants.h" #include "third_party/ocmock/gtest_support.h" #import "third_party/ocmock/OCMock/OCMock.h" #include "ui/gfx/codec/png_codec.h" @@ -44,7 +44,7 @@ using extensions::Extension; @end -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; class ExtensionInstalledBubbleControllerTest : public CocoaProfileTest { diff --git a/chrome/browser/ui/panels/base_panel_browser_test.cc b/chrome/browser/ui/panels/base_panel_browser_test.cc index 69eb6ef..c14adb1 100644 --- a/chrome/browser/ui/panels/base_panel_browser_test.cc +++ b/chrome/browser/ui/panels/base_panel_browser_test.cc @@ -25,12 +25,12 @@ #include "chrome/browser/ui/panels/test_panel_mouse_watcher.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/extensions/extension_manifest_constants.h" #include "chrome/test/base/interactive_test_utils.h" #include "chrome/test/base/ui_test_utils.h" #include "content/public/browser/notification_service.h" #include "content/public/common/url_constants.h" #include "content/public/test/web_contents_tester.h" +#include "extensions/common/manifest_constants.h" #include "sync/api/string_ordinal.h" #if defined(OS_LINUX) @@ -547,8 +547,8 @@ scoped_refptr<Extension> BasePanelBrowserTest::CreateExtension( base::FilePath full_path = extension_prefs->install_directory().Append(path); scoped_ptr<DictionaryValue> input_value(extra_value.DeepCopy()); - input_value->SetString(extension_manifest_keys::kVersion, "1.0.0.0"); - input_value->SetString(extension_manifest_keys::kName, "Sample Extension"); + input_value->SetString(extensions::manifest_keys::kVersion, "1.0.0.0"); + input_value->SetString(extensions::manifest_keys::kName, "Sample Extension"); std::string error; scoped_refptr<Extension> extension = Extension::Create( diff --git a/chrome/browser/ui/sync/profile_signin_confirmation_helper_unittest.cc b/chrome/browser/ui/sync/profile_signin_confirmation_helper_unittest.cc index 0fc79ad..fdaa0a2 100644 --- a/chrome/browser/ui/sync/profile_signin_confirmation_helper_unittest.cc +++ b/chrome/browser/ui/sync/profile_signin_confirmation_helper_unittest.cc @@ -28,7 +28,6 @@ #include "chrome/browser/prefs/browser_prefs.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/extensions/permissions/permission_set.h" #include "chrome/test/base/testing_pref_service_syncable.h" #include "chrome/test/base/testing_profile.h" @@ -36,6 +35,7 @@ #include "components/user_prefs/pref_registry_syncable.h" #include "content/public/test/test_browser_thread_bundle.h" #include "content/public/test/test_utils.h" +#include "extensions/common/manifest_constants.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -97,8 +97,8 @@ static scoped_refptr<extensions::Extension> CreateExtension( const std::string& name, const std::string& id) { DictionaryValue manifest; - manifest.SetString(extension_manifest_keys::kVersion, "1.0.0.0"); - manifest.SetString(extension_manifest_keys::kName, name); + manifest.SetString(extensions::manifest_keys::kVersion, "1.0.0.0"); + manifest.SetString(extensions::manifest_keys::kName, name); std::string error; scoped_refptr<extensions::Extension> extension = extensions::Extension::Create( diff --git a/chrome/browser/ui/webui/policy_ui.cc b/chrome/browser/ui/webui/policy_ui.cc index 83958bf..e1e9824 100644 --- a/chrome/browser/ui/webui/policy_ui.cc +++ b/chrome/browser/ui/webui/policy_ui.cc @@ -63,10 +63,10 @@ #include "chrome/browser/extensions/extension_system.h" #include "chrome/browser/policy/policy_domain_descriptor.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 "components/policy/core/common/policy_schema.h" +#include "extensions/common/manifest_constants.h" #endif namespace em = enterprise_management; @@ -568,7 +568,7 @@ void PolicyUIHandler::SendPolicyNames() const { const extensions::Extension* extension = it->get(); // Skip this extension if it's not an enterprise extension. if (!extension->manifest()->HasPath( - extension_manifest_keys::kStorageManagedSchema)) + extensions::manifest_keys::kStorageManagedSchema)) continue; base::DictionaryValue* extension_value = new base::DictionaryValue; extension_value->SetString("name", extension->name()); @@ -615,7 +615,7 @@ void PolicyUIHandler::SendPolicyValues() const { const extensions::Extension* extension = it->get(); // Skip this extension if it's not an enterprise extension. if (!extension->manifest()->HasPath( - extension_manifest_keys::kStorageManagedSchema)) + extensions::manifest_keys::kStorageManagedSchema)) continue; base::DictionaryValue* extension_policies = new base::DictionaryValue; policy::PolicyNamespace policy_namespace = policy::PolicyNamespace( diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi index 885aed2..ed7b021 100644 --- a/chrome/chrome_common.gypi +++ b/chrome/chrome_common.gypi @@ -80,6 +80,8 @@ '../extensions/common/id_util.h', '../extensions/common/install_warning.cc', '../extensions/common/install_warning.h', + '../extensions/common/manifest_constants.cc', + '../extensions/common/manifest_constants.h', '../extensions/common/matcher/regex_set_matcher.cc', '../extensions/common/matcher/regex_set_matcher.h', '../extensions/common/matcher/string_pattern.cc', diff --git a/chrome/common/extensions/api/commands/commands_handler.cc b/chrome/common/extensions/api/commands/commands_handler.cc index e36213c..51320e7 100644 --- a/chrome/common/extensions/api/commands/commands_handler.cc +++ b/chrome/common/extensions/api/commands/commands_handler.cc @@ -10,10 +10,10 @@ #include "chrome/common/extensions/extension_manifest_constants.h" #include "extensions/common/error_utils.h" -namespace keys = extension_manifest_keys; - namespace extensions { +namespace keys = manifest_keys; + namespace { // The maximum number of commands (including page action/browser actions) with a // keybinding an extension can have. diff --git a/chrome/common/extensions/api/extension_action/action_info.cc b/chrome/common/extensions/api/extension_action/action_info.cc index 6d0ae6d..10e3385 100644 --- a/chrome/common/extensions/api/extension_action/action_info.cc +++ b/chrome/common/extensions/api/extension_action/action_info.cc @@ -13,7 +13,7 @@ #include "extensions/common/error_utils.h" namespace errors = extension_manifest_errors; -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace extensions { diff --git a/chrome/common/extensions/api/extension_action/browser_action_handler.cc b/chrome/common/extensions/api/extension_action/browser_action_handler.cc index 0376745..837f619 100644 --- a/chrome/common/extensions/api/extension_action/browser_action_handler.cc +++ b/chrome/common/extensions/api/extension_action/browser_action_handler.cc @@ -27,7 +27,7 @@ bool BrowserActionHandler::Parse(Extension* extension, string16* error) { const base::DictionaryValue* dict = NULL; if (!extension->manifest()->GetDictionary( - extension_manifest_keys::kBrowserAction, &dict)) { + manifest_keys::kBrowserAction, &dict)) { *error = ASCIIToUTF16(extension_manifest_errors::kInvalidBrowserAction); return false; } @@ -58,7 +58,7 @@ bool BrowserActionHandler::Validate( } const std::vector<std::string> BrowserActionHandler::Keys() const { - return SingleKey(extension_manifest_keys::kBrowserAction); + return SingleKey(manifest_keys::kBrowserAction); } } // namespace extensions diff --git a/chrome/common/extensions/api/extension_action/page_action_handler.cc b/chrome/common/extensions/api/extension_action/page_action_handler.cc index f7b4b9c..7e1ddc5 100644 --- a/chrome/common/extensions/api/extension_action/page_action_handler.cc +++ b/chrome/common/extensions/api/extension_action/page_action_handler.cc @@ -12,7 +12,7 @@ #include "chrome/common/extensions/extension_manifest_constants.h" #include "grit/generated_resources.h" -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace errors = extension_manifest_errors; namespace extensions { diff --git a/chrome/common/extensions/api/extension_action/page_action_manifest_unittest.cc b/chrome/common/extensions/api/extension_action/page_action_manifest_unittest.cc index 15d61d8..ee770d9 100644 --- a/chrome/common/extensions/api/extension_action/page_action_manifest_unittest.cc +++ b/chrome/common/extensions/api/extension_action/page_action_manifest_unittest.cc @@ -10,7 +10,7 @@ #include "testing/gtest/include/gtest/gtest.h" namespace errors = extension_manifest_errors; -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace extensions { diff --git a/chrome/common/extensions/api/extension_action/script_badge_handler.cc b/chrome/common/extensions/api/extension_action/script_badge_handler.cc index e58f89a..7055d1b 100644 --- a/chrome/common/extensions/api/extension_action/script_badge_handler.cc +++ b/chrome/common/extensions/api/extension_action/script_badge_handler.cc @@ -16,7 +16,7 @@ #include "extensions/common/install_warning.h" namespace errors = extension_manifest_errors; -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace extensions { diff --git a/chrome/common/extensions/api/extension_api_unittest.cc b/chrome/common/extensions/api/extension_api_unittest.cc index dc94433..9433df2 100644 --- a/chrome/common/extensions/api/extension_api_unittest.cc +++ b/chrome/common/extensions/api/extension_api_unittest.cc @@ -19,13 +19,13 @@ #include "chrome/common/chrome_paths.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_builder.h" -#include "chrome/common/extensions/extension_manifest_constants.h" #include "chrome/common/extensions/extension_test_util.h" #include "chrome/common/extensions/features/api_feature.h" #include "chrome/common/extensions/features/base_feature_provider.h" #include "chrome/common/extensions/features/simple_feature.h" #include "chrome/common/extensions/manifest.h" #include "chrome/common/extensions/value_builder.h" +#include "extensions/common/manifest_constants.h" #include "testing/gtest/include/gtest/gtest.h" namespace extensions { @@ -468,10 +468,10 @@ TEST(ExtensionAPITest, ExtensionWithUnprivilegedAPIs) { scoped_refptr<Extension> CreateHostedApp() { base::DictionaryValue values; - values.SetString(extension_manifest_keys::kName, "test"); - values.SetString(extension_manifest_keys::kVersion, "0.1"); - values.Set(extension_manifest_keys::kWebURLs, new base::ListValue()); - values.SetString(extension_manifest_keys::kLaunchWebURL, + values.SetString(manifest_keys::kName, "test"); + values.SetString(manifest_keys::kVersion, "0.1"); + values.Set(manifest_keys::kWebURLs, new base::ListValue()); + values.SetString(manifest_keys::kLaunchWebURL, "http://www.example.com"); std::string error; scoped_refptr<Extension> extension(Extension::Create( @@ -484,9 +484,9 @@ scoped_refptr<Extension> CreateHostedApp() { scoped_refptr<Extension> CreatePackagedAppWithPermissions( const std::set<std::string>& permissions) { base::DictionaryValue values; - values.SetString(extension_manifest_keys::kName, "test"); - values.SetString(extension_manifest_keys::kVersion, "0.1"); - values.SetString(extension_manifest_keys::kPlatformAppBackground, + values.SetString(manifest_keys::kName, "test"); + values.SetString(manifest_keys::kVersion, "0.1"); + values.SetString(manifest_keys::kPlatformAppBackground, "http://www.example.com"); base::DictionaryValue* app = new base::DictionaryValue(); @@ -495,7 +495,7 @@ scoped_refptr<Extension> CreatePackagedAppWithPermissions( scripts->Append(new base::StringValue("test.js")); background->Set("scripts", scripts); app->Set("background", background); - values.Set(extension_manifest_keys::kApp, app); + values.Set(manifest_keys::kApp, app); { scoped_ptr<base::ListValue> permissions_list(new base::ListValue()); for (std::set<std::string>::const_iterator i = permissions.begin(); diff --git a/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc b/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc index 07c0e60..1e82270 100644 --- a/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc +++ b/chrome/common/extensions/api/file_browser_handlers/file_browser_handler.cc @@ -16,7 +16,7 @@ #include "extensions/common/error_utils.h" #include "extensions/common/url_pattern.h" -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace errors = extension_manifest_errors; namespace { diff --git a/chrome/common/extensions/api/file_handlers/file_handlers_parser.cc b/chrome/common/extensions/api/file_handlers/file_handlers_parser.cc index 78469f6..be8b858 100644 --- a/chrome/common/extensions/api/file_handlers/file_handlers_parser.cc +++ b/chrome/common/extensions/api/file_handlers/file_handlers_parser.cc @@ -12,7 +12,8 @@ #include "chrome/common/extensions/manifest.h" #include "extensions/common/error_utils.h" -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; +namespace errors = extension_manifest_errors; namespace extensions { @@ -26,7 +27,7 @@ FileHandlers::~FileHandlers() {} const std::vector<FileHandlerInfo>* FileHandlers::GetFileHandlers( const Extension* extension) { FileHandlers* info = static_cast<FileHandlers*>( - extension->GetManifestData(extension_manifest_keys::kFileHandlers)); + extension->GetManifestData(keys::kFileHandlers)); return info ? &info->file_handlers : NULL; } @@ -49,7 +50,7 @@ bool LoadFileHandler(const std::string& handler_id, if (handler_info.HasKey(keys::kFileHandlerTypes) && !handler_info.GetList(keys::kFileHandlerTypes, &mime_types)) { *error = ErrorUtils::FormatErrorMessageUTF16( - extension_manifest_errors::kInvalidFileHandlerType, handler_id); + errors::kInvalidFileHandlerType, handler_id); return false; } @@ -57,21 +58,21 @@ bool LoadFileHandler(const std::string& handler_id, if (handler_info.HasKey(keys::kFileHandlerExtensions) && !handler_info.GetList(keys::kFileHandlerExtensions, &file_extensions)) { *error = ErrorUtils::FormatErrorMessageUTF16( - extension_manifest_errors::kInvalidFileHandlerExtension, handler_id); + errors::kInvalidFileHandlerExtension, handler_id); return false; } if ((!mime_types || mime_types->GetSize() == 0) && (!file_extensions || file_extensions->GetSize() == 0)) { *error = ErrorUtils::FormatErrorMessageUTF16( - extension_manifest_errors::kInvalidFileHandlerNoTypeOrExtension, + errors::kInvalidFileHandlerNoTypeOrExtension, handler_id); return false; } if (handler_info.HasKey(keys::kFileHandlerTitle) && !handler_info.GetString(keys::kFileHandlerTitle, &handler.title)) { - *error = ASCIIToUTF16(extension_manifest_errors::kInvalidFileHandlerTitle); + *error = ASCIIToUTF16(errors::kInvalidFileHandlerTitle); return false; } @@ -80,7 +81,7 @@ bool LoadFileHandler(const std::string& handler_id, for (size_t i = 0; i < mime_types->GetSize(); ++i) { if (!mime_types->GetString(i, &type)) { *error = ErrorUtils::FormatErrorMessageUTF16( - extension_manifest_errors::kInvalidFileHandlerTypeElement, + errors::kInvalidFileHandlerTypeElement, handler_id, std::string(base::IntToString(i))); return false; @@ -94,7 +95,7 @@ bool LoadFileHandler(const std::string& handler_id, for (size_t i = 0; i < file_extensions->GetSize(); ++i) { if (!file_extensions->GetString(i, &file_extension)) { *error = ErrorUtils::FormatErrorMessageUTF16( - extension_manifest_errors::kInvalidFileHandlerExtensionElement, + errors::kInvalidFileHandlerExtensionElement, handler_id, std::string(base::IntToString(i))); return false; @@ -112,7 +113,7 @@ bool FileHandlersParser::Parse(Extension* extension, string16* error) { const base::DictionaryValue* all_handlers = NULL; if (!extension->manifest()->GetDictionary(keys::kFileHandlers, &all_handlers)) { - *error = ASCIIToUTF16(extension_manifest_errors::kInvalidFileHandlers); + *error = ASCIIToUTF16(errors::kInvalidFileHandlers); return false; } @@ -126,7 +127,7 @@ bool FileHandlersParser::Parse(Extension* extension, string16* error) { if (!LoadFileHandler(iter.key(), *handler, &info->file_handlers, error)) return false; } else { - *error = ASCIIToUTF16(extension_manifest_errors::kInvalidFileHandlers); + *error = ASCIIToUTF16(errors::kInvalidFileHandlers); return false; } } diff --git a/chrome/common/extensions/api/i18n/default_locale_handler.cc b/chrome/common/extensions/api/i18n/default_locale_handler.cc index 363128f..0ef3cf3 100644 --- a/chrome/common/extensions/api/i18n/default_locale_handler.cc +++ b/chrome/common/extensions/api/i18n/default_locale_handler.cc @@ -18,7 +18,7 @@ #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace errors = extension_manifest_errors; namespace extensions { diff --git a/chrome/common/extensions/api/identity/extension_manifests_auth_unittest.cc b/chrome/common/extensions/api/identity/extension_manifests_auth_unittest.cc index e4403b0..1f5be34 100644 --- a/chrome/common/extensions/api/identity/extension_manifests_auth_unittest.cc +++ b/chrome/common/extensions/api/identity/extension_manifests_auth_unittest.cc @@ -8,7 +8,7 @@ #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" #include "testing/gtest/include/gtest/gtest.h" -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace errors = extension_manifest_errors; namespace { diff --git a/chrome/common/extensions/api/identity/oauth2_manifest_handler.cc b/chrome/common/extensions/api/identity/oauth2_manifest_handler.cc index 67df919..2697528 100644 --- a/chrome/common/extensions/api/identity/oauth2_manifest_handler.cc +++ b/chrome/common/extensions/api/identity/oauth2_manifest_handler.cc @@ -11,7 +11,7 @@ #include "chrome/common/extensions/extension_manifest_constants.h" #include "extensions/common/error_utils.h" -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace errors = extension_manifest_errors; namespace { diff --git a/chrome/common/extensions/api/input_ime/input_components_handler.cc b/chrome/common/extensions/api/input_ime/input_components_handler.cc index e25112b..3d0548b 100644 --- a/chrome/common/extensions/api/input_ime/input_components_handler.cc +++ b/chrome/common/extensions/api/input_ime/input_components_handler.cc @@ -15,7 +15,7 @@ #include "chrome/common/extensions/manifest_url_handler.h" #include "extensions/common/error_utils.h" -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace errors = extension_manifest_errors; namespace extensions { diff --git a/chrome/common/extensions/api/managed_mode_private/managed_mode_handler.cc b/chrome/common/extensions/api/managed_mode_private/managed_mode_handler.cc index 56e6c10..1935b29 100644 --- a/chrome/common/extensions/api/managed_mode_private/managed_mode_handler.cc +++ b/chrome/common/extensions/api/managed_mode_private/managed_mode_handler.cc @@ -11,10 +11,10 @@ #include "chrome/common/extensions/extension_manifest_constants.h" #include "extensions/common/error_utils.h" -namespace keys = extension_manifest_keys; - namespace extensions { +namespace keys = manifest_keys; + ManagedModeInfo::ManagedModeInfo() { } diff --git a/chrome/common/extensions/api/media_galleries_private/media_galleries_handler.cc b/chrome/common/extensions/api/media_galleries_private/media_galleries_handler.cc index f5231d3..34a8be9 100644 --- a/chrome/common/extensions/api/media_galleries_private/media_galleries_handler.cc +++ b/chrome/common/extensions/api/media_galleries_private/media_galleries_handler.cc @@ -14,7 +14,7 @@ #include "chrome/common/extensions/manifest.h" #include "extensions/common/error_utils.h" -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace errors = extension_manifest_errors; namespace { diff --git a/chrome/common/extensions/api/omnibox/omnibox_handler.cc b/chrome/common/extensions/api/omnibox/omnibox_handler.cc index 7b95ac2..284db71 100644 --- a/chrome/common/extensions/api/omnibox/omnibox_handler.cc +++ b/chrome/common/extensions/api/omnibox/omnibox_handler.cc @@ -24,7 +24,7 @@ const char kKeyword[] = "keyword"; // static const std::string& OmniboxInfo::GetKeyword(const Extension* extension) { OmniboxInfo* info = static_cast<OmniboxInfo*>( - extension->GetManifestData(extension_manifest_keys::kOmnibox)); + extension->GetManifestData(manifest_keys::kOmnibox)); return info ? info->keyword : EmptyString(); } @@ -37,19 +37,19 @@ OmniboxHandler::~OmniboxHandler() { bool OmniboxHandler::Parse(Extension* extension, string16* error) { scoped_ptr<OmniboxInfo> info(new OmniboxInfo); const base::DictionaryValue* dict = NULL; - if (!extension->manifest()->GetDictionary(extension_manifest_keys::kOmnibox, + if (!extension->manifest()->GetDictionary(manifest_keys::kOmnibox, &dict) || !dict->GetString(kKeyword, &info->keyword) || info->keyword.empty()) { *error = ASCIIToUTF16(extension_manifest_errors::kInvalidOmniboxKeyword); return false; } - extension->SetManifestData(extension_manifest_keys::kOmnibox, info.release()); + extension->SetManifestData(manifest_keys::kOmnibox, info.release()); return true; } const std::vector<std::string> OmniboxHandler::Keys() const { - return SingleKey(extension_manifest_keys::kOmnibox); + return SingleKey(manifest_keys::kOmnibox); } } // namespace extensions diff --git a/chrome/common/extensions/api/plugins/plugins_handler.cc b/chrome/common/extensions/api/plugins/plugins_handler.cc index d8decf6..2b25303 100644 --- a/chrome/common/extensions/api/plugins/plugins_handler.cc +++ b/chrome/common/extensions/api/plugins/plugins_handler.cc @@ -21,10 +21,10 @@ #include "base/win/metro.h" #endif -namespace keys = extension_manifest_keys; - namespace extensions { +namespace keys = manifest_keys; + namespace { struct PluginManifestData : Extension::ManifestData { diff --git a/chrome/common/extensions/api/speech/tts_engine_manifest_handler.cc b/chrome/common/extensions/api/speech/tts_engine_manifest_handler.cc index 87f6226..e618d4e 100644 --- a/chrome/common/extensions/api/speech/tts_engine_manifest_handler.cc +++ b/chrome/common/extensions/api/speech/tts_engine_manifest_handler.cc @@ -13,7 +13,7 @@ #include "extensions/common/error_utils.h" #include "ui/base/l10n/l10n_util.h" -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace errors = extension_manifest_errors; namespace { diff --git a/chrome/common/extensions/api/spellcheck/spellcheck_handler.cc b/chrome/common/extensions/api/spellcheck/spellcheck_handler.cc index 039cd2b..b258163 100644 --- a/chrome/common/extensions/api/spellcheck/spellcheck_handler.cc +++ b/chrome/common/extensions/api/spellcheck/spellcheck_handler.cc @@ -9,7 +9,7 @@ namespace extensions { -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace errors = extension_manifest_errors; SpellcheckDictionaryInfo::SpellcheckDictionaryInfo() { diff --git a/chrome/common/extensions/api/storage/storage_schema_manifest_handler.cc b/chrome/common/extensions/api/storage/storage_schema_manifest_handler.cc index 23966d3..d91ccdd 100644 --- a/chrome/common/extensions/api/storage/storage_schema_manifest_handler.cc +++ b/chrome/common/extensions/api/storage/storage_schema_manifest_handler.cc @@ -14,13 +14,13 @@ #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "chrome/common/extensions/extension.h" -#include "chrome/common/extensions/extension_manifest_constants.h" #include "chrome/common/extensions/manifest.h" #include "chrome/common/extensions/permissions/api_permission.h" #include "components/policy/core/common/policy_schema.h" #include "extensions/common/install_warning.h" +#include "extensions/common/manifest_constants.h" -using extension_manifest_keys::kStorageManagedSchema; +using extensions::manifest_keys::kStorageManagedSchema; namespace extensions { diff --git a/chrome/common/extensions/api/system_indicator/system_indicator_handler.cc b/chrome/common/extensions/api/system_indicator/system_indicator_handler.cc index 792a2c4..1636a42 100644 --- a/chrome/common/extensions/api/system_indicator/system_indicator_handler.cc +++ b/chrome/common/extensions/api/system_indicator/system_indicator_handler.cc @@ -24,7 +24,7 @@ SystemIndicatorHandler::~SystemIndicatorHandler() { bool SystemIndicatorHandler::Parse(Extension* extension, string16* error) { const base::DictionaryValue* system_indicator_value = NULL; if (!extension->manifest()->GetDictionary( - extension_manifest_keys::kSystemIndicator, &system_indicator_value)) { + manifest_keys::kSystemIndicator, &system_indicator_value)) { *error = ASCIIToUTF16(extension_manifest_errors::kInvalidSystemIndicator); return false; } @@ -45,7 +45,7 @@ bool SystemIndicatorHandler::Parse(Extension* extension, string16* error) { } const std::vector<std::string> SystemIndicatorHandler::Keys() const { - return SingleKey(extension_manifest_keys::kSystemIndicator); + return SingleKey(manifest_keys::kSystemIndicator); } } // namespace extensions diff --git a/chrome/common/extensions/background_info.cc b/chrome/common/extensions/background_info.cc index f166a58..dcce951 100644 --- a/chrome/common/extensions/background_info.cc +++ b/chrome/common/extensions/background_info.cc @@ -21,7 +21,7 @@ #include "ui/base/l10n/l10n_util.h" using base::DictionaryValue; -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace values = extension_manifest_values; namespace errors = extension_manifest_errors; diff --git a/chrome/common/extensions/command.cc b/chrome/common/extensions/command.cc index 0d529f5..fffc55e 100644 --- a/chrome/common/extensions/command.cc +++ b/chrome/common/extensions/command.cc @@ -16,7 +16,7 @@ #include "ui/base/l10n/l10n_util.h" namespace errors = extension_manifest_errors; -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace values = extension_manifest_values; using extensions::ErrorUtils; diff --git a/chrome/common/extensions/csp_handler.cc b/chrome/common/extensions/csp_handler.cc index fbf2e48..5437f75 100644 --- a/chrome/common/extensions/csp_handler.cc +++ b/chrome/common/extensions/csp_handler.cc @@ -12,7 +12,7 @@ #include "chrome/common/extensions/extension_manifest_constants.h" #include "chrome/common/extensions/manifest_handlers/sandboxed_page_info.h" -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace errors = extension_manifest_errors; using extensions::csp_validator::ContentSecurityPolicyIsLegal; diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc index df10d27..41b75206 100644 --- a/chrome/common/extensions/extension.cc +++ b/chrome/common/extensions/extension.cc @@ -42,7 +42,7 @@ #include "grit/generated_resources.h" #endif -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace values = extension_manifest_values; namespace errors = extension_manifest_errors; @@ -752,13 +752,15 @@ bool Extension::LoadManifestVersion(string16* error) { } manifest_version_ = manifest_->GetManifestVersion(); - if (creation_flags_ & REQUIRE_MODERN_MANIFEST_VERSION && - manifest_version_ < kModernManifestVersion && - !CommandLine::ForCurrentProcess()->HasSwitch( - switches::kAllowLegacyExtensionManifests)) { + if (manifest_version_ < kModernManifestVersion && + ((creation_flags_ & REQUIRE_MODERN_MANIFEST_VERSION && + !CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAllowLegacyExtensionManifests)) || + GetType() == Manifest::TYPE_PLATFORM_APP)) { *error = ErrorUtils::FormatErrorMessageUTF16( errors::kInvalidManifestVersionOld, - base::IntToString(kModernManifestVersion)); + base::IntToString(kModernManifestVersion), + is_platform_app() ? "apps" : "extensions"); return false; } diff --git a/chrome/common/extensions/extension_file_util_unittest.cc b/chrome/common/extensions/extension_file_util_unittest.cc index 24e102c9..6383a12 100644 --- a/chrome/common/extensions/extension_file_util_unittest.cc +++ b/chrome/common/extensions/extension_file_util_unittest.cc @@ -12,9 +12,9 @@ #include "base/strings/utf_string_conversions.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/extensions/extension.h" -#include "chrome/common/extensions/extension_manifest_constants.h" #include "chrome/common/extensions/manifest.h" #include "extensions/common/constants.h" +#include "extensions/common/manifest_constants.h" #include "grit/generated_resources.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -23,7 +23,7 @@ using extensions::Extension; using extensions::Manifest; -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; class ExtensionFileUtilTest : public testing::Test { }; diff --git a/chrome/common/extensions/extension_l10n_util.cc b/chrome/common/extensions/extension_l10n_util.cc index 807deae..07e86cc 100644 --- a/chrome/common/extensions/extension_l10n_util.cc +++ b/chrome/common/extensions/extension_l10n_util.cc @@ -25,7 +25,7 @@ #include "ui/base/l10n/l10n_util.h" namespace errors = extension_manifest_errors; -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; static std::string& GetProcessLocale() { CR_DEFINE_STATIC_LOCAL(std::string, locale, ()); diff --git a/chrome/common/extensions/extension_l10n_util_unittest.cc b/chrome/common/extensions/extension_l10n_util_unittest.cc index e5194ffa..3169675 100644 --- a/chrome/common/extensions/extension_l10n_util_unittest.cc +++ b/chrome/common/extensions/extension_l10n_util_unittest.cc @@ -22,7 +22,7 @@ using extensions::kMessagesFilename; using extensions::MessageBundle; namespace errors = extension_manifest_errors; -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace { diff --git a/chrome/common/extensions/extension_manifest_constants.cc b/chrome/common/extensions/extension_manifest_constants.cc index dff9e6b..69d51e8 100644 --- a/chrome/common/extensions/extension_manifest_constants.cc +++ b/chrome/common/extensions/extension_manifest_constants.cc @@ -4,147 +4,6 @@ #include "chrome/common/extensions/extension_manifest_constants.h" -namespace extension_manifest_keys { - -const char kAllFrames[] = "all_frames"; -const char kAltKey[] = "altKey"; -const char kApp[] = "app"; -const char kAudio[] = "audio"; -const char kBackgroundAllowJsAccess[] = "background.allow_js_access"; -const char kBackgroundPage[] = "background.page"; -const char kBackgroundPageLegacy[] = "background_page"; -const char kBackgroundPersistent[] = "background.persistent"; -const char kBackgroundScripts[] = "background.scripts"; -const char kBrowserAction[] = "browser_action"; -const char kChromeURLOverrides[] = "chrome_url_overrides"; -const char kCommands[] = "commands"; -const char kContentPack[] = "content_pack"; -const char kContentPackSites[] = "sites"; -const char kContentScripts[] = "content_scripts"; -const char kContentSecurityPolicy[] = "content_security_policy"; -const char kConvertedFromUserScript[] = "converted_from_user_script"; -const char kCss[] = "css"; -const char kCtrlKey[] = "ctrlKey"; -const char kCurrentLocale[] = "current_locale"; -const char kDefaultLocale[] = "default_locale"; -const char kDescription[] = "description"; -const char kDevToolsPage[] = "devtools_page"; -const char kDisplayInLauncher[] = "display_in_launcher"; -const char kDisplayInNewTabPage[] = "display_in_new_tab_page"; -const char kEventName[] = "event_name"; -const char kExcludeGlobs[] = "exclude_globs"; -const char kExcludeMatches[] = "exclude_matches"; -const char kExport[] = "export"; -const char kExternallyConnectable[] = "externally_connectable"; -const char kFileAccessList[] = "file_access"; -const char kFileFilters[] = "file_filters"; -const char kFileBrowserHandlers[] = "file_browser_handlers"; -const char kMediaGalleriesHandlers[] = "media_galleries_handlers"; -const char kFileHandlers[] = "file_handlers"; -const char kFileHandlerExtensions[] = "extensions"; -const char kFileHandlerTitle[] = "title"; -const char kFileHandlerTypes[] = "types"; -const char kHomepageURL[] = "homepage_url"; -const char kIcons[] = "icons"; -const char kId[] = "id"; -const char kImport[] = "import"; -const char kIncognito[] = "incognito"; -const char kIncludeGlobs[] = "include_globs"; -const char kInputComponents[] = "input_components"; -const char kIsolation[] = "app.isolation"; -const char kJs[] = "js"; -const char kKey[] = "key"; -const char kKeycode[] = "keyCode"; -const char kKioskEnabled[] = "kiosk_enabled"; -const char kLanguage[] = "language"; -const char kLaunch[] = "app.launch"; -const char kLaunchContainer[] = "app.launch.container"; -const char kLaunchHeight[] = "app.launch.height"; -const char kLaunchLocalPath[] = "app.launch.local_path"; -const char kLaunchWebURL[] = "app.launch.web_url"; -const char kLaunchWidth[] = "app.launch.width"; -const char kLayouts[] = "layouts"; -const char kManifestVersion[] = "manifest_version"; -const char kMatches[] = "matches"; -const char kMinimumChromeVersion[] = "minimum_chrome_version"; -const char kMinimumVersion[] = "minimum_version"; -const char kMIMETypes[] = "mime_types"; -const char kMimeTypesHandler[] = "mime_types_handler"; -const char kName[] = "name"; -const char kNaClModules[] = "nacl_modules"; -const char kNaClModulesMIMEType[] = "mime_type"; -const char kNaClModulesPath[] = "path"; -const char kOAuth2[] = "oauth2"; -const char kOAuth2AutoApprove[] = "oauth2.auto_approve"; -const char kOAuth2ClientId[] = "oauth2.client_id"; -const char kOAuth2Scopes[] = "oauth2.scopes"; -const char kOfflineEnabled[] = "offline_enabled"; -const char kOmnibox[] = "omnibox"; -const char kOmniboxKeyword[] = "omnibox.keyword"; -const char kOptionalPermissions[] = "optional_permissions"; -const char kOptionsPage[] = "options_page"; -const char kPageAction[] = "page_action"; -const char kPageActionDefaultIcon[] = "default_icon"; -const char kPageActionDefaultPopup[] = "default_popup"; -const char kPageActionDefaultTitle[] = "default_title"; -const char kPageActionIcons[] = "icons"; -const char kPageActionId[] = "id"; -const char kPageActionPopup[] = "popup"; -const char kPageActionPopupPath[] = "path"; -const char kPageActions[] = "page_actions"; -const char kPermissions[] = "permissions"; -const char kPlatformAppBackground[] = "app.background"; -const char kPlatformAppBackgroundPage[] = "app.background.page"; -const char kPlatformAppBackgroundScripts[] = "app.background.scripts"; -const char kPlatformAppContentSecurityPolicy[] = "app.content_security_policy"; -const char kPlugins[] = "plugins"; -const char kPluginsPath[] = "path"; -const char kPluginsPublic[] = "public"; -const char kPublicKey[] = "key"; -const char kResources[] = "resources"; -const char kRequirements[] = "requirements"; -const char kRunAt[] = "run_at"; -const char kSandboxedPages[] = "sandbox.pages"; -const char kSandboxedPagesCSP[] = "sandbox.content_security_policy"; -const char kScriptBadge[] = "script_badge"; -const char kShiftKey[] = "shiftKey"; -const char kShortcutKey[] = "shortcutKey"; -const char kSignature[] = "signature"; -const char kSpellcheck[] = "spellcheck"; -const char kSpellcheckDictionaryFormat[] = "dictionary_format"; -const char kSpellcheckDictionaryLanguage[] = "dictionary_language"; -const char kSpellcheckDictionaryLocale[] = "dictionary_locale"; -const char kSpellcheckDictionaryPath[] = "dictionary_path"; -const char kStorageManagedSchema[] = "storage.managed_schema"; -const char kSuggestedKey[] = "suggested_key"; -const char kSystemIndicator[] = "system_indicator"; -const char kSystemInfoDisplay[] = "systemInfo.display"; -const char kTheme[] = "theme"; -const char kThemeColors[] = "colors"; -const char kThemeDisplayProperties[] = "properties"; -const char kThemeImages[] = "images"; -const char kThemeTints[] = "tints"; -const char kTtsEngine[] = "tts_engine"; -const char kTtsGenderFemale[] = "female"; -const char kTtsGenderMale[] = "male"; -const char kTtsVoices[] = "voices"; -const char kTtsVoicesEventTypeEnd[] = "end"; -const char kTtsVoicesEventTypeError[] = "error"; -const char kTtsVoicesEventTypeMarker[] = "marker"; -const char kTtsVoicesEventTypeSentence[] = "sentence"; -const char kTtsVoicesEventTypeStart[] = "start"; -const char kTtsVoicesEventTypeWord[] = "word"; -const char kTtsVoicesEventTypes[] = "event_types"; -const char kTtsVoicesGender[] = "gender"; -const char kTtsVoicesLang[] = "lang"; -const char kTtsVoicesVoiceName[] = "voice_name"; -const char kType[] = "type"; -const char kUpdateURL[] = "update_url"; -const char kVersion[] = "version"; -const char kWebAccessibleResources[] = "web_accessible_resources"; -const char kWebURLs[] = "app.urls"; -} // namespace extension_manifest_keys - namespace extension_manifest_values { const char kBrowserActionCommandEvent[] = "_execute_browser_action"; const char kIncognitoSplit[] = "split"; @@ -415,7 +274,7 @@ const char kInvalidManifestVersion[] = "zero."; const char kInvalidManifestVersionOld[] = "The 'manifest_version' key must be present and set to * (without quotes). " - "See developer.chrome.com/extensions/manifestVersion.html for details."; + "See developer.chrome.com/*/manifestVersion.html for details."; const char kInvalidMatch[] = "Invalid value for 'content_scripts[*].matches[*]': *"; const char kInvalidMatchCount[] = @@ -603,8 +462,6 @@ const char kPermissionNotAllowed[] = "Access to permission '*' denied."; const char kPermissionNotAllowedInManifest[] = "Permission '*' cannot be specified in the manifest."; -const char kPlatformAppNeedsManifestVersion2[] = - "Packaged apps need manifest_version set to >= 2"; const char kReservedMessageFound[] = "Reserved key * found in message catalog."; const char kScriptBadgeRequiresFlag[] = diff --git a/chrome/common/extensions/extension_manifest_constants.h b/chrome/common/extensions/extension_manifest_constants.h index cc56bb6..1d92c71 100644 --- a/chrome/common/extensions/extension_manifest_constants.h +++ b/chrome/common/extensions/extension_manifest_constants.h @@ -8,154 +8,10 @@ #include <string> #include "base/basictypes.h" +// TODO(yoz): Update includers to include this directly. +#include "extensions/common/manifest_constants.h" #include "url/gurl.h" -// Keys used in JSON representation of extensions. -namespace extension_manifest_keys { - extern const char kAllFrames[]; - extern const char kAltKey[]; - extern const char kApp[]; - extern const char kBackgroundAllowJsAccess[]; - extern const char kBackgroundPage[]; - extern const char kBackgroundPageLegacy[]; - extern const char kBackgroundPersistent[]; - extern const char kBackgroundScripts[]; - extern const char kBrowserAction[]; - extern const char kBrowseURLs[]; - extern const char kChromeURLOverrides[]; - extern const char kCommands[]; - extern const char kContentPack[]; - extern const char kContentPackSites[]; - extern const char kContentScripts[]; - extern const char kContentSecurityPolicy[]; - extern const char kConvertedFromUserScript[]; - extern const char kCss[]; - extern const char kCtrlKey[]; - extern const char kCurrentLocale[]; - extern const char kDefaultLocale[]; - extern const char kDescription[]; - extern const char kDevToolsPage[]; - extern const char kDisplayInLauncher[]; - extern const char kDisplayInNewTabPage[]; - extern const char kEventName[]; - extern const char kExcludeGlobs[]; - extern const char kExcludeMatches[]; - extern const char kExport[]; - extern const char kExternallyConnectable[]; - extern const char kFileAccessList[]; - extern const char kFileHandlers[]; - extern const char kFileHandlerExtensions[]; - extern const char kFileHandlerTitle[]; - extern const char kFileHandlerTypes[]; - extern const char kFileFilters[]; - extern const char kFileBrowserHandlers[]; - extern const char kMediaGalleriesHandlers[]; - extern const char kHomepageURL[]; - extern const char kIcons[]; - extern const char kId[]; - extern const char kImport[]; - extern const char kIncognito[]; - extern const char kIncludeGlobs[]; - extern const char kInputComponents[]; - extern const char kIntentDisposition[]; - extern const char kIntentHref[]; - extern const char kIntentPath[]; - extern const char kIntents[]; - extern const char kIntentTitle[]; - extern const char kIntentType[]; - extern const char kIsolation[]; - extern const char kJs[]; - extern const char kKey[]; - extern const char kKeycode[]; - extern const char kKioskEnabled[]; - extern const char kLanguage[]; - extern const char kLaunch[]; - extern const char kLaunchContainer[]; - extern const char kLaunchHeight[]; - extern const char kLaunchLocalPath[]; - extern const char kLaunchWebURL[]; - extern const char kLaunchWidth[]; - extern const char kLayouts[]; - extern const char kManifestVersion[]; - extern const char kMatches[]; - extern const char kMIMETypes[]; - extern const char kMimeTypesHandler[]; - extern const char kMinimumChromeVersion[]; - extern const char kMinimumVersion[]; - extern const char kNaClModules[]; - extern const char kNaClModulesMIMEType[]; - extern const char kNaClModulesPath[]; - extern const char kName[]; - extern const char kOAuth2[]; - extern const char kOAuth2AutoApprove[]; - extern const char kOAuth2ClientId[]; - extern const char kOAuth2Scopes[]; - extern const char kOfflineEnabled[]; - extern const char kOmnibox[]; - extern const char kOmniboxKeyword[]; - extern const char kOptionalPermissions[]; - extern const char kOptionsPage[]; - extern const char kPageAction[]; - extern const char kPageActionDefaultIcon[]; - extern const char kPageActionDefaultPopup[]; - extern const char kPageActionDefaultTitle[]; - extern const char kPageActionIcons[]; - extern const char kPageActionId[]; - extern const char kPageActionPopup[]; - extern const char kPageActionPopupPath[]; - extern const char kPageActions[]; - extern const char kPermissions[]; - extern const char kPlatformAppBackground[]; - extern const char kPlatformAppBackgroundPage[]; - extern const char kPlatformAppBackgroundScripts[]; - extern const char kPlatformAppContentSecurityPolicy[]; - extern const char kPlugins[]; - extern const char kPluginsPath[]; - extern const char kPluginsPublic[]; - extern const char kPublicKey[]; - extern const char kResources[]; - extern const char kRequirements[]; - extern const char kRunAt[]; - extern const char kSandboxedPages[]; - extern const char kSandboxedPagesCSP[]; - extern const char kScriptBadge[]; - extern const char kShiftKey[]; - extern const char kShortcutKey[]; - extern const char kSignature[]; - extern const char kSpellcheck[]; - extern const char kSpellcheckDictionaryFormat[]; - extern const char kSpellcheckDictionaryLanguage[]; - extern const char kSpellcheckDictionaryLocale[]; - extern const char kSpellcheckDictionaryPath[]; - extern const char kStorageManagedSchema[]; - extern const char kSuggestedKey[]; - extern const char kSystemIndicator[]; - extern const char kTheme[]; - extern const char kThemeColors[]; - extern const char kThemeDisplayProperties[]; - extern const char kThemeImages[]; - extern const char kThemeTints[]; - extern const char kTtsEngine[]; - extern const char kTtsGenderFemale[]; - extern const char kTtsGenderMale[]; - extern const char kTtsVoices[]; - extern const char kTtsVoicesEventTypeEnd[]; - extern const char kTtsVoicesEventTypeError[]; - extern const char kTtsVoicesEventTypeMarker[]; - extern const char kTtsVoicesEventTypeSentence[]; - extern const char kTtsVoicesEventTypeStart[]; - extern const char kTtsVoicesEventTypeWord[]; - extern const char kTtsVoicesEventTypes[]; - extern const char kTtsVoicesGender[]; - extern const char kTtsVoicesLang[]; - extern const char kTtsVoicesVoiceName[]; - extern const char kType[]; - extern const char kUpdateURL[]; - extern const char kVersion[]; - extern const char kWebAccessibleResources[]; - extern const char kWebURLs[]; -} // namespace extension_manifest_keys - // Some values expected in manifests. namespace extension_manifest_values { extern const char kBrowserActionCommandEvent[]; @@ -399,7 +255,6 @@ namespace extension_manifest_errors { extern const char kPermissionMustBeOptional[]; extern const char kPermissionNotAllowed[]; extern const char kPermissionNotAllowedInManifest[]; - extern const char kPlatformAppNeedsManifestVersion2[]; extern const char kOneUISurfaceOnly[]; extern const char kReservedMessageFound[]; extern const char kScriptBadgeRequiresFlag[]; diff --git a/chrome/common/extensions/extension_test_util.cc b/chrome/common/extensions/extension_test_util.cc index 02e9b22..a4e66fb 100644 --- a/chrome/common/extensions/extension_test_util.cc +++ b/chrome/common/extensions/extension_test_util.cc @@ -11,7 +11,7 @@ #include "chrome/common/chrome_paths.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_builder.h" -#include "chrome/common/extensions/extension_manifest_constants.h" +#include "extensions/common/manifest_constants.h" #include "testing/gtest/include/gtest/gtest.h" using extensions::DictionaryBuilder; @@ -46,8 +46,8 @@ namespace extension_test_util { scoped_refptr<Extension> CreateExtensionWithID(std::string id) { 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; return Extension::Create(base::FilePath(), extensions::Manifest::INTERNAL, values, Extension::NO_FLAGS, id, &error); diff --git a/chrome/common/extensions/incognito_handler.cc b/chrome/common/extensions/incognito_handler.cc index 20a7471..29d1354 100644 --- a/chrome/common/extensions/incognito_handler.cc +++ b/chrome/common/extensions/incognito_handler.cc @@ -10,10 +10,10 @@ #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_manifest_constants.h" -namespace keys = extension_manifest_keys; - namespace extensions { +namespace keys = manifest_keys; + IncognitoInfo::IncognitoInfo(bool incognito_split_mode) : split_mode(incognito_split_mode) { } diff --git a/chrome/common/extensions/manifest.cc b/chrome/common/extensions/manifest.cc index 008912a..f25b6d2 100644 --- a/chrome/common/extensions/manifest.cc +++ b/chrome/common/extensions/manifest.cc @@ -10,17 +10,16 @@ #include "base/strings/string_split.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" -#include "chrome/common/extensions/extension_manifest_constants.h" #include "chrome/common/extensions/features/feature.h" #include "extensions/common/error_utils.h" #include "extensions/common/features/feature_provider.h" #include "extensions/common/install_warning.h" - -namespace errors = extension_manifest_errors; -namespace keys = extension_manifest_keys; +#include "extensions/common/manifest_constants.h" namespace extensions { +namespace keys = manifest_keys; + namespace { // Rank extension locations in a way that allows @@ -131,10 +130,6 @@ bool Manifest::ValidateManifest( std::string* error, std::vector<InstallWarning>* warnings) const { *error = ""; - if (type_ == Manifest::TYPE_PLATFORM_APP && GetManifestVersion() < 2) { - *error = errors::kPlatformAppNeedsManifestVersion2; - return false; - } // Check every feature to see if its in the manifest. Note that this means // we will ignore keys that are not features; we do this for forward diff --git a/chrome/common/extensions/manifest_handlers/app_isolation_info.cc b/chrome/common/extensions/manifest_handlers/app_isolation_info.cc index 58bf371..a971db4 100644 --- a/chrome/common/extensions/manifest_handlers/app_isolation_info.cc +++ b/chrome/common/extensions/manifest_handlers/app_isolation_info.cc @@ -14,10 +14,10 @@ #include "chrome/common/extensions/permissions/permissions_data.h" #include "extensions/common/error_utils.h" -namespace keys = extension_manifest_keys; - namespace extensions { +namespace keys = manifest_keys; + AppIsolationInfo::AppIsolationInfo(bool isolated_storage) : has_isolated_storage(isolated_storage) { } diff --git a/chrome/common/extensions/manifest_handlers/app_launch_info.cc b/chrome/common/extensions/manifest_handlers/app_launch_info.cc index 813f2b6..4b9ee12 100644 --- a/chrome/common/extensions/manifest_handlers/app_launch_info.cc +++ b/chrome/common/extensions/manifest_handlers/app_launch_info.cc @@ -14,7 +14,7 @@ #include "chrome/common/url_constants.h" #include "extensions/common/error_utils.h" -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace values = extension_manifest_values; namespace errors = extension_manifest_errors; diff --git a/chrome/common/extensions/manifest_handlers/content_scripts_handler.cc b/chrome/common/extensions/manifest_handlers/content_scripts_handler.cc index 8ff7eba..7f3377d 100644 --- a/chrome/common/extensions/manifest_handlers/content_scripts_handler.cc +++ b/chrome/common/extensions/manifest_handlers/content_scripts_handler.cc @@ -25,7 +25,7 @@ namespace extensions { -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace values = extension_manifest_values; namespace errors = extension_manifest_errors; diff --git a/chrome/common/extensions/manifest_handlers/externally_connectable.cc b/chrome/common/extensions/manifest_handlers/externally_connectable.cc index 60f928c..2a6e309 100644 --- a/chrome/common/extensions/manifest_handlers/externally_connectable.cc +++ b/chrome/common/extensions/manifest_handlers/externally_connectable.cc @@ -9,10 +9,10 @@ #include "base/stl_util.h" #include "base/strings/utf_string_conversions.h" #include "chrome/common/extensions/api/manifest_types.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/error_utils.h" +#include "extensions/common/manifest_constants.h" #include "extensions/common/url_pattern.h" #include "net/base/registry_controlled_domains/registry_controlled_domain.h" #include "url/gurl.h" @@ -35,7 +35,7 @@ const char kErrorWildcardHostsNotAllowed[] = "Wildcard domain patterns such as \"*\" are not allowed"; } // namespace externally_connectable_errors -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace errors = externally_connectable_errors; using api::manifest_types::ExternallyConnectable; diff --git a/chrome/common/extensions/manifest_handlers/externally_connectable_unittest.cc b/chrome/common/extensions/manifest_handlers/externally_connectable_unittest.cc index 78857c2..6dc46ac 100644 --- a/chrome/common/extensions/manifest_handlers/externally_connectable_unittest.cc +++ b/chrome/common/extensions/manifest_handlers/externally_connectable_unittest.cc @@ -4,11 +4,11 @@ #include <algorithm> -#include "chrome/common/extensions/extension_manifest_constants.h" #include "chrome/common/extensions/features/feature_channel.h" #include "chrome/common/extensions/manifest_handlers/externally_connectable.h" #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" #include "extensions/common/error_utils.h" +#include "extensions/common/manifest_constants.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -26,7 +26,7 @@ class ExternallyConnectableTest : public ExtensionManifestTest { ExternallyConnectableInfo* GetExternallyConnectableInfo( scoped_refptr<Extension> extension) { return static_cast<ExternallyConnectableInfo*>(extension->GetManifestData( - extension_manifest_keys::kExternallyConnectable)); + manifest_keys::kExternallyConnectable)); } private: diff --git a/chrome/common/extensions/manifest_handlers/icons_handler.cc b/chrome/common/extensions/manifest_handlers/icons_handler.cc index 3105937..a374249 100644 --- a/chrome/common/extensions/manifest_handlers/icons_handler.cc +++ b/chrome/common/extensions/manifest_handlers/icons_handler.cc @@ -20,10 +20,10 @@ #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/size.h" -namespace keys = extension_manifest_keys; - namespace extensions { +namespace keys = manifest_keys; + static base::LazyInstance<ExtensionIconSet> g_empty_icon_set = LAZY_INSTANCE_INITIALIZER; diff --git a/chrome/common/extensions/manifest_handlers/kiosk_enabled_info.cc b/chrome/common/extensions/manifest_handlers/kiosk_enabled_info.cc index 3a77648..df2847c 100644 --- a/chrome/common/extensions/manifest_handlers/kiosk_enabled_info.cc +++ b/chrome/common/extensions/manifest_handlers/kiosk_enabled_info.cc @@ -11,10 +11,10 @@ #include "base/values.h" #include "chrome/common/extensions/extension_manifest_constants.h" -namespace keys = extension_manifest_keys; - namespace extensions { +namespace keys = manifest_keys; + KioskEnabledInfo::KioskEnabledInfo(bool is_kiosk_enabled) : kiosk_enabled(is_kiosk_enabled) { } diff --git a/chrome/common/extensions/manifest_handlers/minimum_chrome_version_checker.cc b/chrome/common/extensions/manifest_handlers/minimum_chrome_version_checker.cc index 4d6ca08..8a125df 100644 --- a/chrome/common/extensions/manifest_handlers/minimum_chrome_version_checker.cc +++ b/chrome/common/extensions/manifest_handlers/minimum_chrome_version_checker.cc @@ -13,7 +13,7 @@ #include "grit/chromium_strings.h" #include "ui/base/l10n/l10n_util.h" -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace errors = extension_manifest_errors; namespace extensions { diff --git a/chrome/common/extensions/manifest_handlers/nacl_modules_handler.cc b/chrome/common/extensions/manifest_handlers/nacl_modules_handler.cc index bf66bd1..78318e9 100644 --- a/chrome/common/extensions/manifest_handlers/nacl_modules_handler.cc +++ b/chrome/common/extensions/manifest_handlers/nacl_modules_handler.cc @@ -14,7 +14,7 @@ namespace extensions { -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace errors = extension_manifest_errors; namespace { diff --git a/chrome/common/extensions/manifest_handlers/offline_enabled_info.cc b/chrome/common/extensions/manifest_handlers/offline_enabled_info.cc index 3f32e52..4cc8ceb 100644 --- a/chrome/common/extensions/manifest_handlers/offline_enabled_info.cc +++ b/chrome/common/extensions/manifest_handlers/offline_enabled_info.cc @@ -11,10 +11,10 @@ #include "base/values.h" #include "chrome/common/extensions/extension_manifest_constants.h" -namespace keys = extension_manifest_keys; - namespace extensions { +namespace keys = manifest_keys; + OfflineEnabledInfo::OfflineEnabledInfo(bool is_offline_enabled) : offline_enabled(is_offline_enabled) { } diff --git a/chrome/common/extensions/manifest_handlers/requirements_handler.cc b/chrome/common/extensions/manifest_handlers/requirements_handler.cc index d0b0ad0..e250d5a 100644 --- a/chrome/common/extensions/manifest_handlers/requirements_handler.cc +++ b/chrome/common/extensions/manifest_handlers/requirements_handler.cc @@ -11,7 +11,7 @@ #include "chrome/common/extensions/extension_manifest_constants.h" #include "extensions/common/error_utils.h" -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace errors = extension_manifest_errors; namespace extensions { diff --git a/chrome/common/extensions/manifest_handlers/sandboxed_page_info.cc b/chrome/common/extensions/manifest_handlers/sandboxed_page_info.cc index 9d2d7b1..c6a3ee1 100644 --- a/chrome/common/extensions/manifest_handlers/sandboxed_page_info.cc +++ b/chrome/common/extensions/manifest_handlers/sandboxed_page_info.cc @@ -18,7 +18,7 @@ namespace extensions { namespace { -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace errors = extension_manifest_errors; const char kDefaultSandboxedPageContentSecurityPolicy[] = diff --git a/chrome/common/extensions/manifest_handlers/shared_module_info.cc b/chrome/common/extensions/manifest_handlers/shared_module_info.cc index dd906b4..6bd8b03 100644 --- a/chrome/common/extensions/manifest_handlers/shared_module_info.cc +++ b/chrome/common/extensions/manifest_handlers/shared_module_info.cc @@ -15,7 +15,7 @@ #include "extensions/common/constants.h" #include "extensions/common/error_utils.h" -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace values = extension_manifest_values; namespace errors = extension_manifest_errors; diff --git a/chrome/common/extensions/manifest_handlers/theme_handler.cc b/chrome/common/extensions/manifest_handlers/theme_handler.cc index f5c8799..4b8003a 100644 --- a/chrome/common/extensions/manifest_handlers/theme_handler.cc +++ b/chrome/common/extensions/manifest_handlers/theme_handler.cc @@ -15,7 +15,7 @@ namespace extensions { -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace errors = extension_manifest_errors; namespace { 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 d2d4fc7..7eefac2 100644 --- a/chrome/common/extensions/manifest_tests/extension_manifests_background_unittest.cc +++ b/chrome/common/extensions/manifest_tests/extension_manifests_background_unittest.cc @@ -16,7 +16,7 @@ #include "testing/gtest/include/gtest/gtest.h" namespace errors = extension_manifest_errors; -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace extensions { diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc index ed579af..92bdf4b 100644 --- a/chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc +++ b/chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc @@ -18,7 +18,7 @@ #endif namespace errors = extension_manifest_errors; -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace extensions { diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_launch_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_launch_unittest.cc index 9a63f61..2393484 100644 --- a/chrome/common/extensions/manifest_tests/extension_manifests_launch_unittest.cc +++ b/chrome/common/extensions/manifest_tests/extension_manifests_launch_unittest.cc @@ -12,7 +12,7 @@ #include "testing/gtest/include/gtest/gtest.h" namespace errors = extension_manifest_errors; -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace extensions { diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc index 3d361b0..b4e5f67 100644 --- a/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc +++ b/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc @@ -11,6 +11,7 @@ #include "chrome/common/extensions/incognito_handler.h" #include "chrome/common/extensions/manifest_handlers/app_isolation_info.h" #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" +#include "extensions/common/error_utils.h" #include "extensions/common/switches.h" #include "testing/gtest/include/gtest/gtest.h" @@ -36,9 +37,10 @@ TEST_F(PlatformAppsManifestTest, PlatformApps) { Testcase error_testcases[] = { Testcase("init_invalid_platform_app_2.json", - errors::kBackgroundRequiredForPlatformApps), + errors::kBackgroundRequiredForPlatformApps), Testcase("init_invalid_platform_app_3.json", - errors::kPlatformAppNeedsManifestVersion2), + ErrorUtils::FormatErrorMessage( + errors::kInvalidManifestVersionOld, "2", "apps")), }; RunTestcases(error_testcases, arraysize(error_testcases), EXPECT_TYPE_ERROR); diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_storage_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_storage_unittest.cc index e0aa833..fc60bac 100644 --- a/chrome/common/extensions/manifest_tests/extension_manifests_storage_unittest.cc +++ b/chrome/common/extensions/manifest_tests/extension_manifests_storage_unittest.cc @@ -4,10 +4,10 @@ #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" +#include "extensions/common/manifest_constants.h" #include "testing/gtest/include/gtest/gtest.h" -#include "chrome/common/extensions/extension_manifest_constants.h" -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; TEST_F(ExtensionManifestTest, StorageAPIManifestVersionAvailability) { base::DictionaryValue base_manifest; diff --git a/chrome/common/extensions/manifest_unittest.cc b/chrome/common/extensions/manifest_unittest.cc index 3f61c50..a6780dc 100644 --- a/chrome/common/extensions/manifest_unittest.cc +++ b/chrome/common/extensions/manifest_unittest.cc @@ -19,7 +19,7 @@ #include "testing/gtest/include/gtest/gtest.h" namespace errors = extension_manifest_errors; -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace extensions { diff --git a/chrome/common/extensions/manifest_url_handler.cc b/chrome/common/extensions/manifest_url_handler.cc index e1fe5ff..3fe56a9 100644 --- a/chrome/common/extensions/manifest_url_handler.cc +++ b/chrome/common/extensions/manifest_url_handler.cc @@ -27,7 +27,7 @@ #include "ui/keyboard/keyboard_constants.h" #endif -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace errors = extension_manifest_errors; namespace extensions { diff --git a/chrome/common/extensions/mime_types_handler.cc b/chrome/common/extensions/mime_types_handler.cc index c85aaed..e519ed5 100644 --- a/chrome/common/extensions/mime_types_handler.cc +++ b/chrome/common/extensions/mime_types_handler.cc @@ -18,7 +18,7 @@ #include "url/gurl.h" #include "url/url_util.h" -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace errors = extension_manifest_errors; namespace { diff --git a/chrome/common/extensions/permissions/permissions_data.cc b/chrome/common/extensions/permissions/permissions_data.cc index 8b5796e..aa3c04a 100644 --- a/chrome/common/extensions/permissions/permissions_data.cc +++ b/chrome/common/extensions/permissions/permissions_data.cc @@ -28,7 +28,7 @@ #include "extensions/common/user_script.h" #include "url/gurl.h" -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace errors = extension_manifest_errors; namespace extensions { diff --git a/chrome/common/extensions/sync_type_unittest.cc b/chrome/common/extensions/sync_type_unittest.cc index 22678e9..0670b9b 100644 --- a/chrome/common/extensions/sync_type_unittest.cc +++ b/chrome/common/extensions/sync_type_unittest.cc @@ -12,7 +12,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace errors = extension_manifest_errors; namespace extensions { diff --git a/chrome/common/extensions/web_accessible_resources_handler.cc b/chrome/common/extensions/web_accessible_resources_handler.cc index 80a34cd..6cf15f3 100644 --- a/chrome/common/extensions/web_accessible_resources_handler.cc +++ b/chrome/common/extensions/web_accessible_resources_handler.cc @@ -14,7 +14,7 @@ namespace extensions { -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace errors = extension_manifest_errors; namespace { diff --git a/chrome/renderer/chrome_content_renderer_client_unittest.cc b/chrome/renderer/chrome_content_renderer_client_unittest.cc index 6eb6c3f..9155400 100644 --- a/chrome/renderer/chrome_content_renderer_client_unittest.cc +++ b/chrome/renderer/chrome_content_renderer_client_unittest.cc @@ -7,8 +7,8 @@ #include "base/strings/utf_string_conversions.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_builder.h" -#include "chrome/common/extensions/extension_manifest_constants.h" #include "content/public/common/webplugininfo.h" +#include "extensions/common/manifest_constants.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/WebKit/public/platform/WebString.h" #include "third_party/WebKit/public/platform/WebVector.h" @@ -91,8 +91,8 @@ scoped_refptr<const extensions::Extension> CreateTestExtension( if (is_hosted_app) { base::ListValue* url_list = new base::ListValue(); url_list->Append(base::Value::CreateStringValue(app_url)); - manifest.Set(extension_manifest_keys::kWebURLs, url_list); - manifest.SetString(extension_manifest_keys::kLaunchWebURL, app_url); + manifest.Set(extensions::manifest_keys::kWebURLs, url_list); + manifest.SetString(extensions::manifest_keys::kLaunchWebURL, app_url); } std::string error; return extensions::Extension::Create(base::FilePath(), location, manifest, diff --git a/chrome/renderer/extensions/dispatcher.cc b/chrome/renderer/extensions/dispatcher.cc index c18e214..47509d2 100644 --- a/chrome/renderer/extensions/dispatcher.cc +++ b/chrome/renderer/extensions/dispatcher.cc @@ -21,7 +21,6 @@ #include "chrome/common/extensions/background_info.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/extensions/extension_messages.h" #include "chrome/common/extensions/features/feature.h" #include "chrome/common/extensions/features/feature_channel.h" @@ -79,6 +78,7 @@ #include "content/public/renderer/v8_value_converter.h" #include "extensions/common/constants.h" #include "extensions/common/features/feature_provider.h" +#include "extensions/common/manifest_constants.h" #include "extensions/common/view_type.h" #include "grit/common_resources.h" #include "grit/renderer_resources.h" @@ -513,8 +513,7 @@ void Dispatcher::OnSetSystemFont(const std::string& font_family, } void Dispatcher::OnSetChannel(int channel) { - extensions::SetCurrentChannel( - static_cast<chrome::VersionInfo::Channel>(channel)); + SetCurrentChannel(static_cast<chrome::VersionInfo::Channel>(channel)); } void Dispatcher::OnMessageInvoke(const std::string& extension_id, @@ -664,7 +663,7 @@ void Dispatcher::AddOrRemoveBindingsForContext(ChromeV8Context* context) { it != extensions_.end(); ++it) { ExternallyConnectableInfo* info = static_cast<ExternallyConnectableInfo*>((*it)->GetManifestData( - extension_manifest_keys::kExternallyConnectable)); + manifest_keys::kExternallyConnectable)); if (info && info->matches.MatchesURL(context->GetURL())) { runtime_is_available = true; break; @@ -1421,11 +1420,10 @@ void Dispatcher::OnCancelSuspend(const std::string& extension_id) { // the frame's security origin is unique. The extension sandbox directive is // checked for in chrome/common/extensions/csp_handler.cc. bool Dispatcher::IsSandboxedPage(const GURL& url) const { - if (url.SchemeIs(extensions::kExtensionScheme)) { + if (url.SchemeIs(kExtensionScheme)) { const Extension* extension = extensions_.GetByID(url.host()); if (extension) { - return extensions::SandboxedPageInfo::IsSandboxedPage(extension, - url.path()); + return SandboxedPageInfo::IsSandboxedPage(extension, url.path()); } } return false; diff --git a/chrome/utility/extensions/unpacker.cc b/chrome/utility/extensions/unpacker.cc index e6bb4bc..087fe19 100644 --- a/chrome/utility/extensions/unpacker.cc +++ b/chrome/utility/extensions/unpacker.cc @@ -35,7 +35,7 @@ #include "ui/gfx/size.h" namespace errors = extension_manifest_errors; -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace { diff --git a/chrome/utility/extensions/unpacker_unittest.cc b/chrome/utility/extensions/unpacker_unittest.cc index 8ddd737..b61a42c 100644 --- a/chrome/utility/extensions/unpacker_unittest.cc +++ b/chrome/utility/extensions/unpacker_unittest.cc @@ -17,7 +17,7 @@ #include "third_party/skia/include/core/SkBitmap.h" namespace errors = extension_manifest_errors; -namespace keys = extension_manifest_keys; +namespace keys = extensions::manifest_keys; namespace extensions { diff --git a/extensions/common/manifest_constants.cc b/extensions/common/manifest_constants.cc new file mode 100644 index 0000000..fcdf6e99 --- /dev/null +++ b/extensions/common/manifest_constants.cc @@ -0,0 +1,151 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "extensions/common/manifest_constants.h" + +namespace extensions { + +namespace manifest_keys { + +const char kAllFrames[] = "all_frames"; +const char kAltKey[] = "altKey"; +const char kApp[] = "app"; +const char kAudio[] = "audio"; +const char kBackgroundAllowJsAccess[] = "background.allow_js_access"; +const char kBackgroundPage[] = "background.page"; +const char kBackgroundPageLegacy[] = "background_page"; +const char kBackgroundPersistent[] = "background.persistent"; +const char kBackgroundScripts[] = "background.scripts"; +const char kBrowserAction[] = "browser_action"; +const char kChromeURLOverrides[] = "chrome_url_overrides"; +const char kCommands[] = "commands"; +const char kContentPack[] = "content_pack"; +const char kContentPackSites[] = "sites"; +const char kContentScripts[] = "content_scripts"; +const char kContentSecurityPolicy[] = "content_security_policy"; +const char kConvertedFromUserScript[] = "converted_from_user_script"; +const char kCss[] = "css"; +const char kCtrlKey[] = "ctrlKey"; +const char kCurrentLocale[] = "current_locale"; +const char kDefaultLocale[] = "default_locale"; +const char kDescription[] = "description"; +const char kDevToolsPage[] = "devtools_page"; +const char kDisplayInLauncher[] = "display_in_launcher"; +const char kDisplayInNewTabPage[] = "display_in_new_tab_page"; +const char kEventName[] = "event_name"; +const char kExcludeGlobs[] = "exclude_globs"; +const char kExcludeMatches[] = "exclude_matches"; +const char kExport[] = "export"; +const char kExternallyConnectable[] = "externally_connectable"; +const char kFileAccessList[] = "file_access"; +const char kFileFilters[] = "file_filters"; +const char kFileBrowserHandlers[] = "file_browser_handlers"; +const char kMediaGalleriesHandlers[] = "media_galleries_handlers"; +const char kFileHandlers[] = "file_handlers"; +const char kFileHandlerExtensions[] = "extensions"; +const char kFileHandlerTitle[] = "title"; +const char kFileHandlerTypes[] = "types"; +const char kHomepageURL[] = "homepage_url"; +const char kIcons[] = "icons"; +const char kId[] = "id"; +const char kImport[] = "import"; +const char kIncognito[] = "incognito"; +const char kIncludeGlobs[] = "include_globs"; +const char kInputComponents[] = "input_components"; +const char kIsolation[] = "app.isolation"; +const char kJs[] = "js"; +const char kKey[] = "key"; +const char kKeycode[] = "keyCode"; +const char kKioskEnabled[] = "kiosk_enabled"; +const char kLanguage[] = "language"; +const char kLaunch[] = "app.launch"; +const char kLaunchContainer[] = "app.launch.container"; +const char kLaunchHeight[] = "app.launch.height"; +const char kLaunchLocalPath[] = "app.launch.local_path"; +const char kLaunchWebURL[] = "app.launch.web_url"; +const char kLaunchWidth[] = "app.launch.width"; +const char kLayouts[] = "layouts"; +const char kManifestVersion[] = "manifest_version"; +const char kMatches[] = "matches"; +const char kMinimumChromeVersion[] = "minimum_chrome_version"; +const char kMinimumVersion[] = "minimum_version"; +const char kMIMETypes[] = "mime_types"; +const char kMimeTypesHandler[] = "mime_types_handler"; +const char kName[] = "name"; +const char kNaClModules[] = "nacl_modules"; +const char kNaClModulesMIMEType[] = "mime_type"; +const char kNaClModulesPath[] = "path"; +const char kOAuth2[] = "oauth2"; +const char kOAuth2AutoApprove[] = "oauth2.auto_approve"; +const char kOAuth2ClientId[] = "oauth2.client_id"; +const char kOAuth2Scopes[] = "oauth2.scopes"; +const char kOfflineEnabled[] = "offline_enabled"; +const char kOmnibox[] = "omnibox"; +const char kOmniboxKeyword[] = "omnibox.keyword"; +const char kOptionalPermissions[] = "optional_permissions"; +const char kOptionsPage[] = "options_page"; +const char kPageAction[] = "page_action"; +const char kPageActionDefaultIcon[] = "default_icon"; +const char kPageActionDefaultPopup[] = "default_popup"; +const char kPageActionDefaultTitle[] = "default_title"; +const char kPageActionIcons[] = "icons"; +const char kPageActionId[] = "id"; +const char kPageActionPopup[] = "popup"; +const char kPageActionPopupPath[] = "path"; +const char kPageActions[] = "page_actions"; +const char kPermissions[] = "permissions"; +const char kPlatformAppBackground[] = "app.background"; +const char kPlatformAppBackgroundPage[] = "app.background.page"; +const char kPlatformAppBackgroundScripts[] = "app.background.scripts"; +const char kPlatformAppContentSecurityPolicy[] = "app.content_security_policy"; +const char kPlugins[] = "plugins"; +const char kPluginsPath[] = "path"; +const char kPluginsPublic[] = "public"; +const char kPublicKey[] = "key"; +const char kResources[] = "resources"; +const char kRequirements[] = "requirements"; +const char kRunAt[] = "run_at"; +const char kSandboxedPages[] = "sandbox.pages"; +const char kSandboxedPagesCSP[] = "sandbox.content_security_policy"; +const char kScriptBadge[] = "script_badge"; +const char kShiftKey[] = "shiftKey"; +const char kShortcutKey[] = "shortcutKey"; +const char kSignature[] = "signature"; +const char kSpellcheck[] = "spellcheck"; +const char kSpellcheckDictionaryFormat[] = "dictionary_format"; +const char kSpellcheckDictionaryLanguage[] = "dictionary_language"; +const char kSpellcheckDictionaryLocale[] = "dictionary_locale"; +const char kSpellcheckDictionaryPath[] = "dictionary_path"; +const char kStorageManagedSchema[] = "storage.managed_schema"; +const char kSuggestedKey[] = "suggested_key"; +const char kSystemIndicator[] = "system_indicator"; +const char kSystemInfoDisplay[] = "systemInfo.display"; +const char kTheme[] = "theme"; +const char kThemeColors[] = "colors"; +const char kThemeDisplayProperties[] = "properties"; +const char kThemeImages[] = "images"; +const char kThemeTints[] = "tints"; +const char kTtsEngine[] = "tts_engine"; +const char kTtsGenderFemale[] = "female"; +const char kTtsGenderMale[] = "male"; +const char kTtsVoices[] = "voices"; +const char kTtsVoicesEventTypeEnd[] = "end"; +const char kTtsVoicesEventTypeError[] = "error"; +const char kTtsVoicesEventTypeMarker[] = "marker"; +const char kTtsVoicesEventTypeSentence[] = "sentence"; +const char kTtsVoicesEventTypeStart[] = "start"; +const char kTtsVoicesEventTypeWord[] = "word"; +const char kTtsVoicesEventTypes[] = "event_types"; +const char kTtsVoicesGender[] = "gender"; +const char kTtsVoicesLang[] = "lang"; +const char kTtsVoicesVoiceName[] = "voice_name"; +const char kType[] = "type"; +const char kUpdateURL[] = "update_url"; +const char kVersion[] = "version"; +const char kWebAccessibleResources[] = "web_accessible_resources"; +const char kWebURLs[] = "app.urls"; + +} // namespace manifest_keys + +} // namespace extensions diff --git a/extensions/common/manifest_constants.h b/extensions/common/manifest_constants.h new file mode 100644 index 0000000..ce31f7c --- /dev/null +++ b/extensions/common/manifest_constants.h @@ -0,0 +1,157 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef EXTENSIONS_COMMON_MANIFEST_CONSTANTS_H_ +#define EXTENSIONS_COMMON_MANIFEST_CONSTANTS_H_ + +// Keys used in JSON representation of extensions. +namespace extensions { +namespace manifest_keys { + extern const char kAllFrames[]; + extern const char kAltKey[]; + extern const char kApp[]; + extern const char kBackgroundAllowJsAccess[]; + extern const char kBackgroundPage[]; + extern const char kBackgroundPageLegacy[]; + extern const char kBackgroundPersistent[]; + extern const char kBackgroundScripts[]; + extern const char kBrowserAction[]; + extern const char kBrowseURLs[]; + extern const char kChromeURLOverrides[]; + extern const char kCommands[]; + extern const char kContentPack[]; + extern const char kContentPackSites[]; + extern const char kContentScripts[]; + extern const char kContentSecurityPolicy[]; + extern const char kConvertedFromUserScript[]; + extern const char kCss[]; + extern const char kCtrlKey[]; + extern const char kCurrentLocale[]; + extern const char kDefaultLocale[]; + extern const char kDescription[]; + extern const char kDevToolsPage[]; + extern const char kDisplayInLauncher[]; + extern const char kDisplayInNewTabPage[]; + extern const char kEventName[]; + extern const char kExcludeGlobs[]; + extern const char kExcludeMatches[]; + extern const char kExport[]; + extern const char kExternallyConnectable[]; + extern const char kFileAccessList[]; + extern const char kFileHandlers[]; + extern const char kFileHandlerExtensions[]; + extern const char kFileHandlerTitle[]; + extern const char kFileHandlerTypes[]; + extern const char kFileFilters[]; + extern const char kFileBrowserHandlers[]; + extern const char kMediaGalleriesHandlers[]; + extern const char kHomepageURL[]; + extern const char kIcons[]; + extern const char kId[]; + extern const char kImport[]; + extern const char kIncognito[]; + extern const char kIncludeGlobs[]; + extern const char kInputComponents[]; + extern const char kIntentDisposition[]; + extern const char kIntentHref[]; + extern const char kIntentPath[]; + extern const char kIntents[]; + extern const char kIntentTitle[]; + extern const char kIntentType[]; + extern const char kIsolation[]; + extern const char kJs[]; + extern const char kKey[]; + extern const char kKeycode[]; + extern const char kKioskEnabled[]; + extern const char kLanguage[]; + extern const char kLaunch[]; + extern const char kLaunchContainer[]; + extern const char kLaunchHeight[]; + extern const char kLaunchLocalPath[]; + extern const char kLaunchWebURL[]; + extern const char kLaunchWidth[]; + extern const char kLayouts[]; + extern const char kManifestVersion[]; + extern const char kMatches[]; + extern const char kMIMETypes[]; + extern const char kMimeTypesHandler[]; + extern const char kMinimumChromeVersion[]; + extern const char kMinimumVersion[]; + extern const char kNaClModules[]; + extern const char kNaClModulesMIMEType[]; + extern const char kNaClModulesPath[]; + extern const char kName[]; + extern const char kOAuth2[]; + extern const char kOAuth2AutoApprove[]; + extern const char kOAuth2ClientId[]; + extern const char kOAuth2Scopes[]; + extern const char kOfflineEnabled[]; + extern const char kOmnibox[]; + extern const char kOmniboxKeyword[]; + extern const char kOptionalPermissions[]; + extern const char kOptionsPage[]; + extern const char kPageAction[]; + extern const char kPageActionDefaultIcon[]; + extern const char kPageActionDefaultPopup[]; + extern const char kPageActionDefaultTitle[]; + extern const char kPageActionIcons[]; + extern const char kPageActionId[]; + extern const char kPageActionPopup[]; + extern const char kPageActionPopupPath[]; + extern const char kPageActions[]; + extern const char kPermissions[]; + extern const char kPlatformAppBackground[]; + extern const char kPlatformAppBackgroundPage[]; + extern const char kPlatformAppBackgroundScripts[]; + extern const char kPlatformAppContentSecurityPolicy[]; + extern const char kPlugins[]; + extern const char kPluginsPath[]; + extern const char kPluginsPublic[]; + extern const char kPublicKey[]; + extern const char kResources[]; + extern const char kRequirements[]; + extern const char kRunAt[]; + extern const char kSandboxedPages[]; + extern const char kSandboxedPagesCSP[]; + extern const char kScriptBadge[]; + extern const char kShiftKey[]; + extern const char kShortcutKey[]; + extern const char kSignature[]; + extern const char kSpellcheck[]; + extern const char kSpellcheckDictionaryFormat[]; + extern const char kSpellcheckDictionaryLanguage[]; + extern const char kSpellcheckDictionaryLocale[]; + extern const char kSpellcheckDictionaryPath[]; + extern const char kStorageManagedSchema[]; + extern const char kSuggestedKey[]; + extern const char kSystemIndicator[]; + extern const char kTheme[]; + extern const char kThemeColors[]; + extern const char kThemeDisplayProperties[]; + extern const char kThemeImages[]; + extern const char kThemeTints[]; + extern const char kTtsEngine[]; + extern const char kTtsGenderFemale[]; + extern const char kTtsGenderMale[]; + extern const char kTtsVoices[]; + extern const char kTtsVoicesEventTypeEnd[]; + extern const char kTtsVoicesEventTypeError[]; + extern const char kTtsVoicesEventTypeMarker[]; + extern const char kTtsVoicesEventTypeSentence[]; + extern const char kTtsVoicesEventTypeStart[]; + extern const char kTtsVoicesEventTypeWord[]; + extern const char kTtsVoicesEventTypes[]; + extern const char kTtsVoicesGender[]; + extern const char kTtsVoicesLang[]; + extern const char kTtsVoicesVoiceName[]; + extern const char kType[]; + extern const char kUpdateURL[]; + extern const char kVersion[]; + extern const char kWebAccessibleResources[]; + extern const char kWebURLs[]; +} // namespace manifest_keys + +} // namespace extensions + +#endif // EXTENSIONS_COMMON_MANIFEST_CONSTANTS_H_ |