diff options
35 files changed, 263 insertions, 238 deletions
diff --git a/chrome/browser/apps/app_browsertest.cc b/chrome/browser/apps/app_browsertest.cc index fccbf55..a871a1f 100644 --- a/chrome/browser/apps/app_browsertest.cc +++ b/chrome/browser/apps/app_browsertest.cc @@ -43,6 +43,7 @@ #include "content/public/browser/web_contents_view.h" #include "content/public/test/test_utils.h" #include "extensions/browser/event_router.h" +#include "extensions/browser/pref_names.h" #include "net/test/embedded_test_server/embedded_test_server.h" #include "url/gurl.h" @@ -1025,7 +1026,7 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, SetRegisteredEvents(extension->id(), std::set<std::string>()); DictionaryPrefUpdate update(extension_prefs->pref_service(), - prefs::kExtensionsPref); + extensions::pref_names::kExtensions); base::DictionaryValue* dict = update.Get(); std::string key(extension->id()); key += ".manifest.version"; diff --git a/chrome/browser/chromeos/extensions/device_local_account_external_policy_loader.cc b/chrome/browser/chromeos/extensions/device_local_account_external_policy_loader.cc index 7430e54..f1e4c97 100644 --- a/chrome/browser/chromeos/extensions/device_local_account_external_policy_loader.cc +++ b/chrome/browser/chromeos/extensions/device_local_account_external_policy_loader.cc @@ -12,6 +12,7 @@ #include "chrome/browser/extensions/policy_handlers.h" #include "chrome/common/pref_names.h" #include "components/policy/core/common/policy_map.h" +#include "extensions/browser/pref_names.h" #include "net/url_request/url_request_context_getter.h" namespace chromeos { @@ -94,7 +95,8 @@ void DeviceLocalAccountExternalPolicyLoader::UpdateExtensionListFromStore() { policy_handler.ApplyPolicySettings(policy_map, &pref_value_map); const base::Value* value = NULL; const base::DictionaryValue* dict = NULL; - if (pref_value_map.GetValue(prefs::kExtensionInstallForceList, &value) && + if (pref_value_map.GetValue(extensions::pref_names::kInstallForceList, + &value) && value->GetAsDictionary(&dict)) { prefs.reset(dict->DeepCopy()); } diff --git a/chrome/browser/extensions/api/management/management_browsertest.cc b/chrome/browser/extensions/api/management/management_browsertest.cc index c98dcd3..ce3bf76 100644 --- a/chrome/browser/extensions/api/management/management_browsertest.cc +++ b/chrome/browser/extensions/api/management/management_browsertest.cc @@ -26,6 +26,7 @@ #include "content/public/browser/render_view_host.h" #include "content/public/test/browser_test_utils.h" #include "content/test/net/url_request_prepackaged_interceptor.h" +#include "extensions/browser/pref_names.h" #include "net/url_request/url_fetcher.h" using extensions::Extension; @@ -496,12 +497,13 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementTest, ExternalPolicyRefresh) { PrefService* prefs = browser()->profile()->GetPrefs(); const base::DictionaryValue* forcelist = - prefs->GetDictionary(prefs::kExtensionInstallForceList); + prefs->GetDictionary(extensions::pref_names::kInstallForceList); ASSERT_TRUE(forcelist->empty()) << kForceInstallNotEmptyHelp; { // Set the policy as a user preference and fire notification observers. - DictionaryPrefUpdate pref_update(prefs, prefs::kExtensionInstallForceList); + DictionaryPrefUpdate pref_update(prefs, + extensions::pref_names::kInstallForceList); base::DictionaryValue* forcelist = pref_update.Get(); extensions::ExternalPolicyLoader::AddExtension( forcelist, kExtensionId, "http://localhost/autoupdate/manifest"); @@ -532,7 +534,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementTest, ExternalPolicyRefresh) { EXPECT_EQ(0u, service->disabled_extensions()->size()); // Check that emptying the list triggers uninstall. - prefs->ClearPref(prefs::kExtensionInstallForceList); + prefs->ClearPref(extensions::pref_names::kInstallForceList); EXPECT_EQ(size_before + 1, service->extensions()->size()); EXPECT_FALSE(service->GetExtensionById(kExtensionId, true)); } @@ -568,7 +570,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementTest, // Check that the policy is initially empty. PrefService* prefs = browser()->profile()->GetPrefs(); const base::DictionaryValue* forcelist = - prefs->GetDictionary(prefs::kExtensionInstallForceList); + prefs->GetDictionary(extensions::pref_names::kInstallForceList); ASSERT_TRUE(forcelist->empty()) << kForceInstallNotEmptyHelp; // User install of the extension. @@ -581,7 +583,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementTest, // Setup the force install policy. It should override the location. { - DictionaryPrefUpdate pref_update(prefs, prefs::kExtensionInstallForceList); + DictionaryPrefUpdate pref_update(prefs, + extensions::pref_names::kInstallForceList); extensions::ExternalPolicyLoader::AddExtension( pref_update.Get(), kExtensionId, "http://localhost/autoupdate/manifest"); @@ -597,7 +600,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementTest, // TODO(joaodasilva): it would be nicer if the extension was kept instead, // and reverted location to INTERNAL or whatever it was before the policy // was applied. - prefs->ClearPref(prefs::kExtensionInstallForceList); + prefs->ClearPref(extensions::pref_names::kInstallForceList); ASSERT_EQ(size_before, service->extensions()->size()); extension = service->GetExtensionById(kExtensionId, true); EXPECT_FALSE(extension); @@ -620,7 +623,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementTest, // Install the policy again. It should overwrite the extension's location, // and force enable it too. { - DictionaryPrefUpdate pref_update(prefs, prefs::kExtensionInstallForceList); + DictionaryPrefUpdate pref_update(prefs, + extensions::pref_names::kInstallForceList); base::DictionaryValue* forcelist = pref_update.Get(); extensions::ExternalPolicyLoader::AddExtension( forcelist, kExtensionId, "http://localhost/autoupdate/manifest"); diff --git a/chrome/browser/extensions/api/messaging/native_message_process_host.cc b/chrome/browser/extensions/api/messaging/native_message_process_host.cc index 417144f..3ed751a 100644 --- a/chrome/browser/extensions/api/messaging/native_message_process_host.cc +++ b/chrome/browser/extensions/api/messaging/native_message_process_host.cc @@ -15,7 +15,7 @@ #include "chrome/browser/extensions/api/messaging/native_messaging_host_manifest.h" #include "chrome/browser/extensions/api/messaging/native_process_launcher.h" #include "chrome/common/chrome_version_info.h" -#include "chrome/common/pref_names.h" +#include "extensions/browser/pref_names.h" #include "extensions/common/constants.h" #include "extensions/common/features/feature.h" #include "net/base/file_stream.h" @@ -56,10 +56,10 @@ bool NativeMessageProcessHost::IsHostAllowed( const PrefService* pref_service, const std::string& native_host_name) { // All native messaging hosts are allowed if there is no blacklist. - if (!pref_service->IsManagedPreference(prefs::kNativeMessagingBlacklist)) + if (!pref_service->IsManagedPreference(pref_names::kNativeMessagingBlacklist)) return true; const base::ListValue* blacklist = - pref_service->GetList(prefs::kNativeMessagingBlacklist); + pref_service->GetList(pref_names::kNativeMessagingBlacklist); if (!blacklist) return true; @@ -72,9 +72,10 @@ bool NativeMessageProcessHost::IsHostAllowed( } // The native messaging host is blacklisted. Check the whitelist. - if (pref_service->IsManagedPreference(prefs::kNativeMessagingWhitelist)) { + if (pref_service->IsManagedPreference( + pref_names::kNativeMessagingWhitelist)) { const base::ListValue* whitelist = - pref_service->GetList(prefs::kNativeMessagingWhitelist); + pref_service->GetList(pref_names::kNativeMessagingWhitelist); if (whitelist && whitelist->Find(name_value) != whitelist->end()) return true; } diff --git a/chrome/browser/extensions/api/preference/preference_api.cc b/chrome/browser/extensions/api/preference/preference_api.cc index d2b2198..d04f6c0 100644 --- a/chrome/browser/extensions/api/preference/preference_api.cc +++ b/chrome/browser/extensions/api/preference/preference_api.cc @@ -426,7 +426,7 @@ void PreferenceAPI::LoadExtensionControlledPrefs( std::string key = extension_id + "." + scope_string; const base::DictionaryValue* source_dict = prefs->pref_service()-> - GetDictionary(prefs::kExtensionsPref); + GetDictionary(pref_names::kExtensions); const base::DictionaryValue* preferences = NULL; if (!source_dict->GetDictionary(key, &preferences)) return; diff --git a/chrome/browser/extensions/chrome_extensions_browser_client.cc b/chrome/browser/extensions/chrome_extensions_browser_client.cc index e85e244..5ed2495 100644 --- a/chrome/browser/extensions/chrome_extensions_browser_client.cc +++ b/chrome/browser/extensions/chrome_extensions_browser_client.cc @@ -20,6 +20,7 @@ #include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_version_info.h" #include "chrome/common/pref_names.h" +#include "extensions/browser/pref_names.h" #if defined(OS_CHROMEOS) #include "chromeos/chromeos_switches.h" @@ -131,15 +132,15 @@ bool ChromeExtensionsBrowserClient::DidVersionUpdate( PrefService* pref_service = extension_prefs->pref_service(); base::Version last_version; - if (pref_service->HasPrefPath(prefs::kExtensionsLastChromeVersion)) { + if (pref_service->HasPrefPath(pref_names::kLastChromeVersion)) { std::string last_version_str = - pref_service->GetString(prefs::kExtensionsLastChromeVersion); + pref_service->GetString(pref_names::kLastChromeVersion); last_version = base::Version(last_version_str); } chrome::VersionInfo current_version_info; std::string current_version = current_version_info.Version(); - pref_service->SetString(prefs::kExtensionsLastChromeVersion, + pref_service->SetString(pref_names::kLastChromeVersion, current_version); // If there was no version string in prefs, assume we're out of date. diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc index aa20ce1..9f416a0 100644 --- a/chrome/browser/extensions/extension_prefs.cc +++ b/chrome/browser/extensions/extension_prefs.cc @@ -16,7 +16,6 @@ #include "chrome/browser/extensions/api/preference/preference_api.h" #include "chrome/browser/extensions/extension_pref_store.h" #include "chrome/browser/extensions/extension_prefs_factory.h" -#include "chrome/common/pref_names.h" #include "components/user_prefs/pref_registry_syncable.h" #include "extensions/browser/admin_policy.h" #include "extensions/browser/app_sorting.h" @@ -182,7 +181,7 @@ class ScopedExtensionPrefUpdate : public DictionaryPrefUpdate { public: ScopedExtensionPrefUpdate(PrefService* service, const std::string& extension_id) : - DictionaryPrefUpdate(service, prefs::kExtensionsPref), + DictionaryPrefUpdate(service, pref_names::kExtensions), extension_id_(extension_id) {} virtual ~ScopedExtensionPrefUpdate() { @@ -242,7 +241,7 @@ ExtensionPrefs::ScopedUpdate<T, type_enum_value>::ScopedUpdate( ExtensionPrefs* prefs, const std::string& extension_id, const std::string& key) - : update_(prefs->pref_service(), prefs::kExtensionsPref), + : update_(prefs->pref_service(), pref_names::kExtensions), extension_id_(extension_id), key_(key) { DCHECK(Extension::IdIsValid(extension_id_)); @@ -350,7 +349,7 @@ static base::FilePath::StringType MakePathRelative(const base::FilePath& parent, void ExtensionPrefs::MakePathsRelative() { const base::DictionaryValue* dict = - prefs_->GetDictionary(prefs::kExtensionsPref); + prefs_->GetDictionary(pref_names::kExtensions); if (!dict || dict->empty()) return; @@ -378,7 +377,7 @@ void ExtensionPrefs::MakePathsRelative() { return; // Fix these paths. - DictionaryPrefUpdate update(prefs_, prefs::kExtensionsPref); + DictionaryPrefUpdate update(prefs_, pref_names::kExtensions); base::DictionaryValue* update_dict = update.Get(); for (std::set<std::string>::iterator i = absolute_keys.begin(); i != absolute_keys.end(); ++i) { @@ -398,7 +397,7 @@ void ExtensionPrefs::MakePathsRelative() { const base::DictionaryValue* ExtensionPrefs::GetExtensionPref( const std::string& extension_id) const { const base::DictionaryValue* extensions = - prefs_->GetDictionary(prefs::kExtensionsPref); + prefs_->GetDictionary(pref_names::kExtensions); const base::DictionaryValue* extension_dict = NULL; if (!extensions || !extensions->GetDictionary(extension_id, &extension_dict)) { @@ -424,7 +423,7 @@ void ExtensionPrefs::UpdateExtensionPref(const std::string& extension_id, void ExtensionPrefs::DeleteExtensionPrefs(const std::string& extension_id) { extension_pref_value_map_->UnregisterExtension(extension_id); content_settings_store_->UnregisterExtension(extension_id); - DictionaryPrefUpdate update(prefs_, prefs::kExtensionsPref); + DictionaryPrefUpdate update(prefs_, pref_names::kExtensions); base::DictionaryValue* dict = update.Get(); dict->Remove(extension_id, NULL); } @@ -679,16 +678,16 @@ void ExtensionPrefs::SetWipeoutAcknowledged( } bool ExtensionPrefs::SetAlertSystemFirstRun() { - if (prefs_->GetBoolean(prefs::kExtensionAlertsInitializedPref)) { + if (prefs_->GetBoolean(pref_names::kAlertsInitialized)) { return true; } - prefs_->SetBoolean(prefs::kExtensionAlertsInitializedPref, true); + prefs_->SetBoolean(pref_names::kAlertsInitialized, true); return false; } bool ExtensionPrefs::ExtensionsBlacklistedByDefault() const { return admin_policy::BlacklistedByDefault( - prefs_->GetList(prefs::kExtensionInstallDenyList)); + prefs_->GetList(pref_names::kInstallDenyList)); } bool ExtensionPrefs::DidExtensionEscalatePermissions( @@ -741,7 +740,7 @@ std::set<std::string> ExtensionPrefs::GetBlacklistedExtensions() { std::set<std::string> ids; const base::DictionaryValue* extensions = - prefs_->GetDictionary(prefs::kExtensionsPref); + prefs_->GetDictionary(pref_names::kExtensions); if (!extensions) return ids; @@ -1087,21 +1086,21 @@ bool ExtensionPrefs::IsExtensionDisabled( ExtensionIdList ExtensionPrefs::GetToolbarOrder() { ExtensionIdList id_list_out; - GetUserExtensionPrefIntoContainer(prefs::kExtensionToolbar, &id_list_out); + GetUserExtensionPrefIntoContainer(pref_names::kToolbar, &id_list_out); return id_list_out; } void ExtensionPrefs::SetToolbarOrder(const ExtensionIdList& extension_ids) { - SetExtensionPrefFromContainer(prefs::kExtensionToolbar, extension_ids); + SetExtensionPrefFromContainer(pref_names::kToolbar, extension_ids); } bool ExtensionPrefs::GetKnownDisabled(ExtensionIdSet* id_set_out) { - return GetUserExtensionPrefIntoContainer(prefs::kExtensionKnownDisabled, + return GetUserExtensionPrefIntoContainer(pref_names::kKnownDisabled, id_set_out); } void ExtensionPrefs::SetKnownDisabled(const ExtensionIdSet& extension_ids) { - SetExtensionPrefFromContainer(prefs::kExtensionKnownDisabled, extension_ids); + SetExtensionPrefFromContainer(pref_names::kKnownDisabled, extension_ids); } void ExtensionPrefs::OnExtensionInstalled( @@ -1232,7 +1231,7 @@ scoped_ptr<ExtensionInfo> ExtensionPrefs::GetInstalledExtensionInfo( const std::string& extension_id) const { const base::DictionaryValue* ext = NULL; const base::DictionaryValue* extensions = - prefs_->GetDictionary(prefs::kExtensionsPref); + prefs_->GetDictionary(pref_names::kExtensions); if (!extensions || !extensions->GetDictionaryWithoutPathExpansion(extension_id, &ext)) return scoped_ptr<ExtensionInfo>(); @@ -1257,7 +1256,7 @@ ExtensionPrefs::GetInstalledExtensionsInfo() const { scoped_ptr<ExtensionsInfo> extensions_info(new ExtensionsInfo); const base::DictionaryValue* extensions = - prefs_->GetDictionary(prefs::kExtensionsPref); + prefs_->GetDictionary(pref_names::kExtensions); for (base::DictionaryValue::Iterator extension_id(*extensions); !extension_id.IsAtEnd(); extension_id.Advance()) { if (!Extension::IdIsValid(extension_id.key())) @@ -1277,7 +1276,7 @@ ExtensionPrefs::GetUninstalledExtensionsInfo() const { scoped_ptr<ExtensionsInfo> extensions_info(new ExtensionsInfo); const base::DictionaryValue* extensions = - prefs_->GetDictionary(prefs::kExtensionsPref); + prefs_->GetDictionary(pref_names::kExtensions); for (base::DictionaryValue::Iterator extension_id(*extensions); !extension_id.IsAtEnd(); extension_id.Advance()) { const base::DictionaryValue* ext = NULL; @@ -1407,7 +1406,7 @@ scoped_ptr<ExtensionPrefs::ExtensionsInfo> ExtensionPrefs:: scoped_ptr<ExtensionsInfo> extensions_info(new ExtensionsInfo); const base::DictionaryValue* extensions = - prefs_->GetDictionary(prefs::kExtensionsPref); + prefs_->GetDictionary(pref_names::kExtensions); for (base::DictionaryValue::Iterator extension_id(*extensions); !extension_id.IsAtEnd(); extension_id.Advance()) { if (!Extension::IdIsValid(extension_id.key())) @@ -1539,7 +1538,7 @@ ExtensionIdList ExtensionPrefs::GetExtensionsFrom( const base::DictionaryValue* extension_prefs = NULL; const base::Value* extension_prefs_value = - pref_service->GetUserPrefValue(prefs::kExtensionsPref); + pref_service->GetUserPrefValue(pref_names::kExtensions); if (!extension_prefs_value || !extension_prefs_value->GetAsDictionary(&extension_prefs)) { return result; // Empty set @@ -1617,7 +1616,7 @@ bool ExtensionPrefs::HasIncognitoPrefValue(const std::string& pref_key) { URLPatternSet ExtensionPrefs::GetAllowedInstallSites() { URLPatternSet result; const base::ListValue* list = - prefs_->GetList(prefs::kExtensionAllowedInstallSites); + prefs_->GetList(pref_names::kAllowedInstallSites); CHECK(list); for (size_t i = 0; i < list->GetSize(); ++i) { @@ -1626,8 +1625,7 @@ URLPatternSet ExtensionPrefs::GetAllowedInstallSites() { if (!list->GetString(i, &entry_string) || entry.Parse(entry_string) != URLPattern::PARSE_SUCCESS) { LOG(ERROR) << "Invalid value for preference: " - << prefs::kExtensionAllowedInstallSites - << "." << i; + << pref_names::kAllowedInstallSites << "." << i; continue; } result.AddPattern(entry); @@ -1691,64 +1689,60 @@ ExtensionPrefs::ExtensionPrefs( } void ExtensionPrefs::SetNeedsStorageGarbageCollection(bool value) { - prefs_->SetBoolean(prefs::kExtensionStorageGarbageCollect, value); + prefs_->SetBoolean(pref_names::kStorageGarbageCollect, value); } bool ExtensionPrefs::NeedsStorageGarbageCollection() { - return prefs_->GetBoolean(prefs::kExtensionStorageGarbageCollect); + return prefs_->GetBoolean(pref_names::kStorageGarbageCollect); } // static void ExtensionPrefs::RegisterProfilePrefs( user_prefs::PrefRegistrySyncable* registry) { registry->RegisterDictionaryPref( - prefs::kExtensionsPref, + pref_names::kExtensions, user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterListPref(prefs::kExtensionToolbar, + registry->RegisterListPref(pref_names::kToolbar, user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); registry->RegisterIntegerPref( - prefs::kExtensionToolbarSize, + pref_names::kToolbarSize, -1, // default value user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); registry->RegisterDictionaryPref( kExtensionsBlacklistUpdate, user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterListPref(prefs::kExtensionInstallAllowList, + registry->RegisterListPref(pref_names::kInstallAllowList, user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterListPref(prefs::kExtensionInstallDenyList, + registry->RegisterListPref(pref_names::kInstallDenyList, user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); registry->RegisterDictionaryPref( - prefs::kExtensionInstallForceList, + pref_names::kInstallForceList, user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterListPref(prefs::kExtensionAllowedTypes, + registry->RegisterListPref(pref_names::kAllowedTypes, user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterStringPref( - prefs::kExtensionBlacklistUpdateVersion, - "0", // default value - user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); registry->RegisterBooleanPref( - prefs::kExtensionStorageGarbageCollect, + pref_names::kStorageGarbageCollect, false, // default value user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); registry->RegisterInt64Pref( - prefs::kLastExtensionsUpdateCheck, + pref_names::kLastUpdateCheck, 0, // default value user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); registry->RegisterInt64Pref( - prefs::kNextExtensionsUpdateCheck, + pref_names::kNextUpdateCheck, 0, // default value user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterListPref(prefs::kExtensionAllowedInstallSites, + registry->RegisterListPref(pref_names::kAllowedInstallSites, user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); registry->RegisterStringPref( - prefs::kExtensionsLastChromeVersion, + pref_names::kLastChromeVersion, std::string(), // default value user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterListPref(prefs::kExtensionKnownDisabled, + registry->RegisterListPref(pref_names::kKnownDisabled, user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); #if defined(TOOLKIT_VIEWS) registry->RegisterIntegerPref( - prefs::kBrowserActionContainerWidth, + pref_names::kBrowserActionContainerWidth, 0, user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); #endif @@ -1756,9 +1750,9 @@ void ExtensionPrefs::RegisterProfilePrefs( kInstallSignature, user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterListPref(prefs::kNativeMessagingBlacklist, + registry->RegisterListPref(pref_names::kNativeMessagingBlacklist, user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); - registry->RegisterListPref(prefs::kNativeMessagingWhitelist, + registry->RegisterListPref(pref_names::kNativeMessagingWhitelist, user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); } diff --git a/chrome/browser/extensions/extension_prefs.h b/chrome/browser/extensions/extension_prefs.h index 465c02f..cc8d510 100644 --- a/chrome/browser/extensions/extension_prefs.h +++ b/chrome/browser/extensions/extension_prefs.h @@ -477,7 +477,7 @@ class ExtensionPrefs : public ExtensionScopedPrefs, AppSorting* app_sorting() const { return app_sorting_.get(); } // Describes the URLs that are able to install extensions. See - // prefs::kExtensionAllowedInstallSites for more information. + // pref_names::kAllowedInstallSites for more information. URLPatternSet GetAllowedInstallSites(); // Schedules garbage collection of an extension's on-disk data on the next diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc index 5dff290..bd076a9 100644 --- a/chrome/browser/extensions/extension_service.cc +++ b/chrome/browser/extensions/extension_service.cc @@ -80,6 +80,7 @@ #include "extensions/browser/external_provider_interface.h" #include "extensions/browser/management_policy.h" #include "extensions/browser/pending_extension_manager.h" +#include "extensions/browser/pref_names.h" #include "extensions/browser/process_manager.h" #include "extensions/browser/update_observer.h" #include "extensions/common/constants.h" @@ -364,9 +365,11 @@ ExtensionService::ExtensionService(Profile* profile, base::Closure callback = base::Bind(&ExtensionService::OnExtensionInstallPrefChanged, base::Unretained(this)); - pref_change_registrar_.Add(prefs::kExtensionInstallAllowList, callback); - pref_change_registrar_.Add(prefs::kExtensionInstallDenyList, callback); - pref_change_registrar_.Add(prefs::kExtensionAllowedTypes, callback); + pref_change_registrar_.Add(extensions::pref_names::kInstallAllowList, + callback); + pref_change_registrar_.Add(extensions::pref_names::kInstallDenyList, + callback); + pref_change_registrar_.Add(extensions::pref_names::kAllowedTypes, callback); // Set up the ExtensionUpdater if (autoupdate_enabled) { diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc index 61187fd..5134473 100644 --- a/chrome/browser/extensions/extension_service_unittest.cc +++ b/chrome/browser/extensions/extension_service_unittest.cc @@ -93,6 +93,7 @@ #include "extensions/browser/management_policy.h" #include "extensions/browser/pending_extension_info.h" #include "extensions/browser/pending_extension_manager.h" +#include "extensions/browser/pref_names.h" #include "extensions/browser/test_management_policy.h" #include "extensions/common/constants.h" #include "extensions/common/extension.h" @@ -3473,7 +3474,7 @@ TEST_F(ExtensionServiceTest, UnloadBlacklistedExtensionPolicy) { base::ListValue whitelist; PrefService* prefs = service_->extension_prefs()->pref_service(); whitelist.Append(new base::StringValue(good_crx)); - prefs->Set(prefs::kExtensionInstallAllowList, whitelist); + prefs->Set(extensions::pref_names::kInstallAllowList, whitelist); test_blacklist.SetBlacklistState( good_crx, extensions::BLACKLISTED_MALWARE, true); @@ -3558,7 +3559,7 @@ TEST_F(ExtensionServiceTest, BlacklistedByPolicyWillNotInstall) { // Blacklist everything. { ListPrefUpdate update(profile_->GetPrefs(), - prefs::kExtensionInstallDenyList); + extensions::pref_names::kInstallDenyList); base::ListValue* blacklist = update.Get(); blacklist->Append(new base::StringValue("*")); } @@ -3571,7 +3572,7 @@ TEST_F(ExtensionServiceTest, BlacklistedByPolicyWillNotInstall) { // Now whitelist this particular extension. { ListPrefUpdate update(profile_->GetPrefs(), - prefs::kExtensionInstallAllowList); + extensions::pref_names::kInstallAllowList); base::ListValue* whitelist = update.Get(); whitelist->Append(new base::StringValue(good_crx)); } @@ -3592,7 +3593,7 @@ TEST_F(ExtensionServiceTest, BlacklistedByPolicyRemovedIfRunning) { { // Scope for pref update notification. PrefService* prefs = profile_->GetPrefs(); - ListPrefUpdate update(prefs, prefs::kExtensionInstallDenyList); + ListPrefUpdate update(prefs, extensions::pref_names::kInstallDenyList); base::ListValue* blacklist = update.Get(); ASSERT_TRUE(blacklist != NULL); @@ -3612,7 +3613,7 @@ TEST_F(ExtensionServiceTest, ComponentExtensionWhitelisted) { // Blacklist everything. { ListPrefUpdate update(profile_->GetPrefs(), - prefs::kExtensionInstallDenyList); + extensions::pref_names::kInstallDenyList); base::ListValue* blacklist = update.Get(); blacklist->Append(new base::StringValue("*")); } @@ -3641,7 +3642,7 @@ TEST_F(ExtensionServiceTest, ComponentExtensionWhitelisted) { // Extension should not be uninstalled on blacklist changes. { ListPrefUpdate update(profile_->GetPrefs(), - prefs::kExtensionInstallDenyList); + extensions::pref_names::kInstallDenyList); base::ListValue* blacklist = update.Get(); blacklist->Append(new base::StringValue(good0)); } @@ -3656,14 +3657,15 @@ TEST_F(ExtensionServiceTest, PolicyInstalledExtensionsWhitelisted) { { // Blacklist everything. - ListPrefUpdate blacklist_update(profile_->GetPrefs(), - prefs::kExtensionInstallDenyList); + ListPrefUpdate blacklist_update( + profile_->GetPrefs(), extensions::pref_names::kInstallDenyList); base::ListValue* blacklist = blacklist_update.Get(); blacklist->AppendString("*"); // Mark good.crx for force-installation. - DictionaryPrefUpdate forcelist_update(profile_->GetPrefs(), - prefs::kExtensionInstallForceList); + DictionaryPrefUpdate forcelist_update( + profile_->GetPrefs(), + extensions::pref_names::kInstallForceList); extensions::ExternalPolicyLoader::AddExtension( forcelist_update.Get(), good_crx, "http://example.com/update_url"); } @@ -3691,7 +3693,7 @@ TEST_F(ExtensionServiceTest, PolicyInstalledExtensionsWhitelisted) { // Blacklist update should not uninstall the extension. { ListPrefUpdate update(profile_->GetPrefs(), - prefs::kExtensionInstallDenyList); + extensions::pref_names::kInstallDenyList); base::ListValue* blacklist = update.Get(); blacklist->Append(new base::StringValue(good0)); } diff --git a/chrome/browser/extensions/extension_toolbar_model.cc b/chrome/browser/extensions/extension_toolbar_model.cc index e180acf..b1bb1a0 100644 --- a/chrome/browser/extensions/extension_toolbar_model.cc +++ b/chrome/browser/extensions/extension_toolbar_model.cc @@ -24,6 +24,7 @@ #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_source.h" #include "content/public/browser/web_contents.h" +#include "extensions/browser/pref_names.h" #include "extensions/common/extension.h" #include "extensions/common/extension_set.h" #include "extensions/common/feature_switch.h" @@ -57,13 +58,15 @@ ExtensionToolbarModel::ExtensionToolbarModel( this, chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED, content::Source<extensions::ExtensionPrefs>(extension_prefs_)); - visible_icon_count_ = prefs_->GetInteger(prefs::kExtensionToolbarSize); + visible_icon_count_ = prefs_->GetInteger( + extensions::pref_names::kToolbarSize); pref_change_registrar_.Init(prefs_); pref_change_callback_ = base::Bind(&ExtensionToolbarModel::OnExtensionToolbarPrefChange, base::Unretained(this)); - pref_change_registrar_.Add(prefs::kExtensionToolbar, pref_change_callback_); + pref_change_registrar_.Add(extensions::pref_names::kToolbar, + pref_change_callback_); } ExtensionToolbarModel::~ExtensionToolbarModel() { @@ -166,7 +169,7 @@ ExtensionToolbarModel::Action ExtensionToolbarModel::ExecuteBrowserAction( void ExtensionToolbarModel::SetVisibleIconCount(int count) { visible_icon_count_ = count == static_cast<int>(toolbar_items_.size()) ? -1 : count; - prefs_->SetInteger(prefs::kExtensionToolbarSize, visible_icon_count_); + prefs_->SetInteger(extensions::pref_names::kToolbarSize, visible_icon_count_); } void ExtensionToolbarModel::Observe( @@ -391,9 +394,10 @@ void ExtensionToolbarModel::UpdatePrefs() { return; // Don't observe change caused by self. - pref_change_registrar_.Remove(prefs::kExtensionToolbar); + pref_change_registrar_.Remove(extensions::pref_names::kToolbar); extension_prefs_->SetToolbarOrder(last_known_positions_); - pref_change_registrar_.Add(prefs::kExtensionToolbar, pref_change_callback_); + pref_change_registrar_.Add(extensions::pref_names::kToolbar, + pref_change_callback_); } int ExtensionToolbarModel::IncognitoIndexToOriginal(int incognito_index) { diff --git a/chrome/browser/extensions/external_policy_loader.cc b/chrome/browser/extensions/external_policy_loader.cc index ddf509a..a1e9e6ed 100644 --- a/chrome/browser/extensions/external_policy_loader.cc +++ b/chrome/browser/extensions/external_policy_loader.cc @@ -15,16 +15,17 @@ #include "chrome/common/pref_names.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_source.h" +#include "extensions/browser/pref_names.h" namespace extensions { ExternalPolicyLoader::ExternalPolicyLoader(Profile* profile) : profile_(profile) { pref_change_registrar_.Init(profile_->GetPrefs()); - pref_change_registrar_.Add(prefs::kExtensionInstallForceList, + pref_change_registrar_.Add(pref_names::kInstallForceList, base::Bind(&ExternalPolicyLoader::StartLoading, base::Unretained(this))); - pref_change_registrar_.Add(prefs::kExtensionAllowedTypes, + pref_change_registrar_.Add(pref_names::kAllowedTypes, base::Bind(&ExternalPolicyLoader::StartLoading, base::Unretained(this))); notification_registrar_.Add(this, @@ -57,7 +58,7 @@ void ExternalPolicyLoader::Observe( void ExternalPolicyLoader::StartLoading() { const base::DictionaryValue* forcelist = - profile_->GetPrefs()->GetDictionary(prefs::kExtensionInstallForceList); + profile_->GetPrefs()->GetDictionary(pref_names::kInstallForceList); prefs_.reset(forcelist ? forcelist->DeepCopy() : NULL); LoadFinished(); } diff --git a/chrome/browser/extensions/external_policy_loader.h b/chrome/browser/extensions/external_policy_loader.h index 700810e..fecd54d 100644 --- a/chrome/browser/extensions/external_policy_loader.h +++ b/chrome/browser/extensions/external_policy_loader.h @@ -22,7 +22,7 @@ class DictionaryValue; namespace extensions { // A specialization of the ExternalProvider that uses -// prefs::kExtensionInstallForceList to look up which external extensions are +// pref_names::kInstallForceList to look up which external extensions are // registered. class ExternalPolicyLoader : public ExternalLoader, diff --git a/chrome/browser/extensions/external_policy_loader_unittest.cc b/chrome/browser/extensions/external_policy_loader_unittest.cc index de36941..74d00d5 100644 --- a/chrome/browser/extensions/external_policy_loader_unittest.cc +++ b/chrome/browser/extensions/external_policy_loader_unittest.cc @@ -16,6 +16,7 @@ #include "chrome/test/base/testing_profile.h" #include "content/public/test/test_browser_thread.h" #include "extensions/browser/external_provider_interface.h" +#include "extensions/browser/pref_names.h" #include "extensions/common/extension.h" #include "extensions/common/manifest.h" #include "testing/gtest/include/gtest/gtest.h" @@ -50,8 +51,7 @@ class MockExternalPolicyProviderVisitor const std::set<std::string>& expected_extensions) { profile_.reset(new TestingProfile); profile_->GetTestingPrefService()->SetManagedPref( - prefs::kExtensionInstallForceList, - policy_forcelist.DeepCopy()); + pref_names::kInstallForceList, policy_forcelist.DeepCopy()); provider_.reset(new ExternalProviderImpl( this, new ExternalPolicyLoader(profile_.get()), diff --git a/chrome/browser/extensions/install_tracker.cc b/chrome/browser/extensions/install_tracker.cc index b84af2b..a0dcd4e 100644 --- a/chrome/browser/extensions/install_tracker.cc +++ b/chrome/browser/extensions/install_tracker.cc @@ -9,6 +9,7 @@ #include "chrome/browser/extensions/extension_prefs.h" #include "chrome/common/pref_names.h" #include "content/public/browser/notification_service.h" +#include "extensions/browser/pref_names.h" namespace extensions { @@ -30,7 +31,7 @@ InstallTracker::InstallTracker(Profile* profile, content::Source<Profile>(profile)); pref_change_registrar_.Init(prefs->pref_service()); - pref_change_registrar_.Add(prefs::kExtensionsPref, + pref_change_registrar_.Add(pref_names::kExtensions, base::Bind(&InstallTracker::OnAppsReordered, base::Unretained(this))); } diff --git a/chrome/browser/extensions/install_verifier.cc b/chrome/browser/extensions/install_verifier.cc index c0b862b..752ab20 100644 --- a/chrome/browser/extensions/install_verifier.cc +++ b/chrome/browser/extensions/install_verifier.cc @@ -19,6 +19,7 @@ #include "chrome/common/extensions/manifest_url_handler.h" #include "chrome/common/pref_names.h" #include "content/public/common/content_switches.h" +#include "extensions/browser/pref_names.h" #include "extensions/common/manifest.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" @@ -349,16 +350,16 @@ void InstallVerifier::GarbageCollect() { bool InstallVerifier::AllowedByEnterprisePolicy(const std::string& id) const { PrefService* pref_service = prefs_->pref_service(); - if (pref_service->IsManagedPreference(prefs::kExtensionInstallAllowList)) { + if (pref_service->IsManagedPreference(pref_names::kInstallAllowList)) { const base::ListValue* whitelist = - pref_service->GetList(prefs::kExtensionInstallAllowList); + pref_service->GetList(pref_names::kInstallAllowList); base::StringValue id_value(id); if (whitelist && whitelist->Find(id_value) != whitelist->end()) return true; } - if (pref_service->IsManagedPreference(prefs::kExtensionInstallForceList)) { + if (pref_service->IsManagedPreference(pref_names::kInstallForceList)) { const base::DictionaryValue* forcelist = - pref_service->GetDictionary(prefs::kExtensionInstallForceList); + pref_service->GetDictionary(pref_names::kInstallForceList); if (forcelist && forcelist->HasKey(id)) return true; } diff --git a/chrome/browser/extensions/policy_handlers.cc b/chrome/browser/extensions/policy_handlers.cc index 21ee3ac..3c94f6d 100644 --- a/chrome/browser/extensions/policy_handlers.cc +++ b/chrome/browser/extensions/policy_handlers.cc @@ -10,6 +10,7 @@ #include "chrome/common/pref_names.h" #include "components/policy/core/browser/policy_error_map.h" #include "components/policy/core/common/policy_map.h" +#include "extensions/browser/pref_names.h" #include "extensions/common/extension.h" #include "grit/component_strings.h" #include "policy/policy_constants.h" @@ -119,7 +120,7 @@ void ExtensionInstallForcelistPolicyHandler::ApplyPolicySettings( if (CheckAndGetValue(policies, NULL, &value) && value && ParseList(value, dict.get(), NULL)) { - prefs->SetValue(prefs::kExtensionInstallForceList, dict.release()); + prefs->SetValue(pref_names::kInstallForceList, dict.release()); } } diff --git a/chrome/browser/extensions/policy_handlers_unittest.cc b/chrome/browser/extensions/policy_handlers_unittest.cc index 8cbd467..e163ab8 100644 --- a/chrome/browser/extensions/policy_handlers_unittest.cc +++ b/chrome/browser/extensions/policy_handlers_unittest.cc @@ -8,6 +8,7 @@ #include "chrome/common/pref_names.h" #include "components/policy/core/browser/policy_error_map.h" #include "components/policy/core/common/policy_map.h" +#include "extensions/browser/pref_names.h" #include "policy/policy_constants.h" #include "testing/gtest/include/gtest/gtest.h" @@ -168,7 +169,7 @@ TEST(ExtensionInstallForcelistPolicyHandlerTest, ApplyPolicySettings) { ExtensionInstallForcelistPolicyHandler handler; handler.ApplyPolicySettings(policy_map, &prefs); - EXPECT_FALSE(prefs.GetValue(prefs::kExtensionInstallForceList, &value)); + EXPECT_FALSE(prefs.GetValue(pref_names::kInstallForceList, &value)); EXPECT_FALSE(value); policy_map.Set(policy::key::kExtensionInstallForcelist, @@ -177,7 +178,7 @@ TEST(ExtensionInstallForcelistPolicyHandlerTest, ApplyPolicySettings) { policy.DeepCopy(), NULL); handler.ApplyPolicySettings(policy_map, &prefs); - EXPECT_TRUE(prefs.GetValue(prefs::kExtensionInstallForceList, &value)); + EXPECT_TRUE(prefs.GetValue(pref_names::kInstallForceList, &value)); EXPECT_TRUE(base::Value::Equals(&expected, value)); policy.AppendString("abcdefghijklmnopabcdefghijklmnop;http://example.com"); @@ -189,7 +190,7 @@ TEST(ExtensionInstallForcelistPolicyHandlerTest, ApplyPolicySettings) { policy.DeepCopy(), NULL); handler.ApplyPolicySettings(policy_map, &prefs); - EXPECT_TRUE(prefs.GetValue(prefs::kExtensionInstallForceList, &value)); + EXPECT_TRUE(prefs.GetValue(pref_names::kInstallForceList, &value)); EXPECT_TRUE(base::Value::Equals(&expected, value)); policy.AppendString("invalid"); @@ -199,7 +200,7 @@ TEST(ExtensionInstallForcelistPolicyHandlerTest, ApplyPolicySettings) { policy.DeepCopy(), NULL); handler.ApplyPolicySettings(policy_map, &prefs); - EXPECT_TRUE(prefs.GetValue(prefs::kExtensionInstallForceList, &value)); + EXPECT_TRUE(prefs.GetValue(pref_names::kInstallForceList, &value)); EXPECT_TRUE(base::Value::Equals(&expected, value)); } diff --git a/chrome/browser/extensions/standard_management_policy_provider.cc b/chrome/browser/extensions/standard_management_policy_provider.cc index a9a0d34..923e70c 100644 --- a/chrome/browser/extensions/standard_management_policy_provider.cc +++ b/chrome/browser/extensions/standard_management_policy_provider.cc @@ -9,6 +9,7 @@ #include "chrome/browser/extensions/extension_prefs.h" #include "chrome/common/pref_names.h" #include "extensions/browser/admin_policy.h" +#include "extensions/browser/pref_names.h" #include "extensions/common/extension.h" namespace extensions { @@ -37,14 +38,14 @@ bool StandardManagementPolicyProvider::UserMayLoad( PrefService* pref_service = prefs_->pref_service(); const base::ListValue* blacklist = - pref_service->GetList(prefs::kExtensionInstallDenyList); + pref_service->GetList(pref_names::kInstallDenyList); const base::ListValue* whitelist = - pref_service->GetList(prefs::kExtensionInstallAllowList); + pref_service->GetList(pref_names::kInstallAllowList); const base::DictionaryValue* forcelist = - pref_service->GetDictionary(prefs::kExtensionInstallForceList); + pref_service->GetDictionary(pref_names::kInstallForceList); const base::ListValue* allowed_types = NULL; - if (pref_service->HasPrefPath(prefs::kExtensionAllowedTypes)) - allowed_types = pref_service->GetList(prefs::kExtensionAllowedTypes); + if (pref_service->HasPrefPath(pref_names::kAllowedTypes)) + allowed_types = pref_service->GetList(pref_names::kAllowedTypes); return admin_policy::UserMayLoad( blacklist, whitelist, forcelist, allowed_types, extension, error); diff --git a/chrome/browser/extensions/updater/extension_updater.cc b/chrome/browser/extensions/updater/extension_updater.cc index f629a85..7813887 100644 --- a/chrome/browser/extensions/updater/extension_updater.cc +++ b/chrome/browser/extensions/updater/extension_updater.cc @@ -29,6 +29,7 @@ #include "content/public/browser/notification_source.h" #include "crypto/sha2.h" #include "extensions/browser/pending_extension_manager.h" +#include "extensions/browser/pref_names.h" #include "extensions/common/constants.h" #include "extensions/common/extension.h" #include "extensions/common/extension_set.h" @@ -39,8 +40,6 @@ using base::RandInt; using base::Time; using base::TimeDelta; using content::BrowserThread; -using prefs::kLastExtensionsUpdateCheck; -using prefs::kNextExtensionsUpdateCheck; typedef extensions::ExtensionDownloaderDelegate::Error Error; typedef extensions::ExtensionDownloaderDelegate::PingResult PingResult; @@ -165,14 +164,14 @@ TimeDelta ExtensionUpdater::DetermineFirstCheckDelay() { return TimeDelta::FromSeconds(frequency_seconds_); // If we've never scheduled a check before, start at frequency_seconds_. - if (!prefs_->HasPrefPath(kNextExtensionsUpdateCheck)) + if (!prefs_->HasPrefPath(pref_names::kNextUpdateCheck)) return TimeDelta::FromSeconds(frequency_seconds_); // If it's been a long time since our last actual check, we want to do one // relatively soon. Time now = Time::Now(); Time last = Time::FromInternalValue(prefs_->GetInt64( - kLastExtensionsUpdateCheck)); + pref_names::kLastUpdateCheck)); int days = (now - last).InDays(); if (days >= 30) { // Wait 5-10 minutes. @@ -191,7 +190,7 @@ TimeDelta ExtensionUpdater::DetermineFirstCheckDelay() { // Read the persisted next check time, and use that if it isn't too soon. // Otherwise pick something random. Time saved_next = Time::FromInternalValue(prefs_->GetInt64( - kNextExtensionsUpdateCheck)); + pref_names::kNextUpdateCheck)); Time earliest = now + TimeDelta::FromSeconds(kStartupWaitSeconds); if (saved_next >= earliest) { return saved_next - now; @@ -241,7 +240,7 @@ void ExtensionUpdater::ScheduleNextCheck(const TimeDelta& target_delay) { // Save the time of next check. Time next = Time::Now() + actual_delay; - prefs_->SetInt64(kNextExtensionsUpdateCheck, next.ToInternalValue()); + prefs_->SetInt64(pref_names::kNextUpdateCheck, next.ToInternalValue()); timer_.Start(FROM_HERE, actual_delay, this, &ExtensionUpdater::TimerFired); } @@ -254,7 +253,7 @@ void ExtensionUpdater::TimerFired() { // this. if (frequency_seconds_ == extensions::kDefaultUpdateFrequencySeconds) { Time last = Time::FromInternalValue(prefs_->GetInt64( - kLastExtensionsUpdateCheck)); + pref_names::kLastUpdateCheck)); if (last.ToInternalValue() != 0) { // Use counts rather than time so we can use minutes rather than millis. UMA_HISTOGRAM_CUSTOM_COUNTS("Extensions.UpdateCheckGap", @@ -267,7 +266,7 @@ void ExtensionUpdater::TimerFired() { // Save the last check time, and schedule the next check. int64 now = Time::Now().ToInternalValue(); - prefs_->SetInt64(kLastExtensionsUpdateCheck, now); + prefs_->SetInt64(pref_names::kLastUpdateCheck, now); ScheduleNextCheck(TimeDelta::FromSeconds(frequency_seconds_)); } diff --git a/chrome/browser/media_galleries/media_galleries_preferences.cc b/chrome/browser/media_galleries/media_galleries_preferences.cc index 6f76f23..5575cc6 100644 --- a/chrome/browser/media_galleries/media_galleries_preferences.cc +++ b/chrome/browser/media_galleries/media_galleries_preferences.cc @@ -31,6 +31,7 @@ #include "chrome/common/pref_names.h" #include "components/user_prefs/pref_registry_syncable.h" #include "content/public/browser/browser_thread.h" +#include "extensions/browser/pref_names.h" #include "extensions/common/extension.h" #include "extensions/common/extension_set.h" #include "extensions/common/permissions/api_permission.h" @@ -1165,7 +1166,7 @@ void MediaGalleriesPreferences::RemoveGalleryPermissionsFromPrefs( DCHECK(IsInitialized()); ExtensionPrefs* prefs = GetExtensionPrefs(); const base::DictionaryValue* extensions = - prefs->pref_service()->GetDictionary(prefs::kExtensionsPref); + prefs->pref_service()->GetDictionary(extensions::pref_names::kExtensions); if (!extensions) return; diff --git a/chrome/browser/policy/configuration_policy_handler_list_factory.cc b/chrome/browser/policy/configuration_policy_handler_list_factory.cc index 791b296..ebc9208 100644 --- a/chrome/browser/policy/configuration_policy_handler_list_factory.cc +++ b/chrome/browser/policy/configuration_policy_handler_list_factory.cc @@ -25,6 +25,7 @@ #include "components/policy/core/common/policy_details.h" #include "components/policy/core/common/policy_map.h" #include "components/policy/core/common/policy_pref_names.h" +#include "extensions/browser/pref_names.h" #include "extensions/common/manifest.h" #include "grit/component_strings.h" #include "policy/policy_constants.h" @@ -494,23 +495,23 @@ scoped_ptr<ConfigurationPolicyHandlerList> BuildHandlerList() { handlers->AddHandler(make_scoped_ptr<ConfigurationPolicyHandler>( new extensions::ExtensionListPolicyHandler( key::kExtensionInstallWhitelist, - prefs::kExtensionInstallAllowList, + extensions::pref_names::kInstallAllowList, false))); handlers->AddHandler(make_scoped_ptr<ConfigurationPolicyHandler>( new extensions::ExtensionListPolicyHandler( key::kExtensionInstallBlacklist, - prefs::kExtensionInstallDenyList, + extensions::pref_names::kInstallDenyList, true))); handlers->AddHandler(make_scoped_ptr<ConfigurationPolicyHandler>( new extensions::ExtensionInstallForcelistPolicyHandler())); handlers->AddHandler(make_scoped_ptr<ConfigurationPolicyHandler>( new extensions::ExtensionURLPatternListPolicyHandler( key::kExtensionInstallSources, - prefs::kExtensionAllowedInstallSites))); + extensions::pref_names::kAllowedInstallSites))); handlers->AddHandler(make_scoped_ptr<ConfigurationPolicyHandler>( new StringToIntEnumListPolicyHandler( key::kExtensionAllowedTypes, - prefs::kExtensionAllowedTypes, + extensions::pref_names::kAllowedTypes, kExtensionAllowedTypesMap, kExtensionAllowedTypesMap + arraysize(kExtensionAllowedTypesMap)))); #if defined(OS_CHROMEOS) @@ -530,12 +531,12 @@ scoped_ptr<ConfigurationPolicyHandlerList> BuildHandlerList() { handlers->AddHandler(make_scoped_ptr<ConfigurationPolicyHandler>( new extensions::NativeMessagingHostListPolicyHandler( key::kNativeMessagingWhitelist, - prefs::kNativeMessagingWhitelist, + extensions::pref_names::kNativeMessagingWhitelist, false))); handlers->AddHandler(make_scoped_ptr<ConfigurationPolicyHandler>( new extensions::NativeMessagingHostListPolicyHandler( key::kNativeMessagingBlacklist, - prefs::kNativeMessagingBlacklist, + extensions::pref_names::kNativeMessagingBlacklist, true))); #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) && !defined(OS_IOS) diff --git a/chrome/browser/prefs/chrome_pref_service_factory.cc b/chrome/browser/prefs/chrome_pref_service_factory.cc index 1410784..5e502ec 100644 --- a/chrome/browser/prefs/chrome_pref_service_factory.cc +++ b/chrome/browser/prefs/chrome_pref_service_factory.cc @@ -28,6 +28,7 @@ #include "components/user_prefs/pref_registry_syncable.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" +#include "extensions/browser/pref_names.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -56,7 +57,7 @@ const PrefHashFilter::TrackedPreference kTrackedPrefs[] = { { 2, prefs::kHomePage, true }, { 3, prefs::kRestoreOnStartup, true }, { 4, prefs::kURLsToRestoreOnStartup, true }, - { 5, prefs::kExtensionsPref, false }, + { 5, extensions::pref_names::kExtensions, false }, { 6, prefs::kGoogleServicesLastUsername, true }, { 7, prefs::kSearchProviderOverrides, true }, { 8, prefs::kDefaultSearchProviderSearchURL, true }, @@ -65,7 +66,7 @@ const PrefHashFilter::TrackedPreference kTrackedPrefs[] = { #if !defined(OS_ANDROID) { 11, prefs::kPinnedTabs, true }, #endif - { 12, prefs::kExtensionKnownDisabled, true }, + { 12, extensions::pref_names::kKnownDisabled, true }, { 13, prefs::kProfileResetPromptMemento, true }, }; diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc index a68abad..abdb17f 100644 --- a/chrome/browser/profiles/profile.cc +++ b/chrome/browser/profiles/profile.cc @@ -20,6 +20,7 @@ #include "content/public/browser/notification_source.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" +#include "extensions/browser/pref_names.h" #if defined(OS_CHROMEOS) #include "base/command_line.h" @@ -94,7 +95,7 @@ void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { false, user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); registry->RegisterBooleanPref( - prefs::kExtensionAlertsInitializedPref, + extensions::pref_names::kAlertsInitialized, false, user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); registry->RegisterStringPref( diff --git a/chrome/browser/ui/app_list/recommended_apps.cc b/chrome/browser/ui/app_list/recommended_apps.cc index 6e11212..71441d9 100644 --- a/chrome/browser/ui/app_list/recommended_apps.cc +++ b/chrome/browser/ui/app_list/recommended_apps.cc @@ -15,6 +15,7 @@ #include "chrome/browser/extensions/install_tracker_factory.h" #include "chrome/browser/ui/app_list/recommended_apps_observer.h" #include "chrome/common/pref_names.h" +#include "extensions/browser/pref_names.h" #include "extensions/common/extension.h" #include "extensions/common/extension_set.h" @@ -45,7 +46,7 @@ RecommendedApps::RecommendedApps(Profile* profile) : profile_(profile) { extensions::ExtensionSystem::Get(profile_)->extension_service(); extensions::ExtensionPrefs* prefs = service->extension_prefs(); pref_change_registrar_.Init(prefs->pref_service()); - pref_change_registrar_.Add(prefs::kExtensionsPref, + pref_change_registrar_.Add(extensions::pref_names::kExtensions, base::Bind(&RecommendedApps::Update, base::Unretained(this))); diff --git a/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm b/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm index a84a241..f6b435e 100644 --- a/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm +++ b/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm @@ -32,6 +32,7 @@ #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_source.h" +#include "extensions/browser/pref_names.h" #include "grit/theme_resources.h" #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSAnimation+Duration.h" @@ -386,11 +387,12 @@ class ExtensionServiceObserverBridge : public content::NotificationObserver, - (CGFloat)savedWidth { if (!toolbarModel_) return 0; - if (!profile_->GetPrefs()->HasPrefPath(prefs::kExtensionToolbarSize)) { + if (!profile_->GetPrefs()->HasPrefPath( + extensions::pref_names::kToolbarSize)) { // Migration code to the new VisibleIconCount pref. // TODO(mpcomplete): remove this at some point. - double predefinedWidth = - profile_->GetPrefs()->GetDouble(prefs::kBrowserActionContainerWidth); + double predefinedWidth = profile_->GetPrefs()->GetDouble( + extensions::pref_names::kBrowserActionContainerWidth); if (predefinedWidth != 0) { int iconWidth = kBrowserActionWidth + kBrowserActionButtonPadding; int extraWidth = kChevronWidth; diff --git a/chrome/browser/ui/cocoa/extensions/browser_actions_controller_prefs.cc b/chrome/browser/ui/cocoa/extensions/browser_actions_controller_prefs.cc index dc73c96..a98920ef 100644 --- a/chrome/browser/ui/cocoa/extensions/browser_actions_controller_prefs.cc +++ b/chrome/browser/ui/cocoa/extensions/browser_actions_controller_prefs.cc @@ -4,13 +4,13 @@ #include "chrome/browser/ui/cocoa/extensions/browser_actions_controller_prefs.h" -#include "chrome/common/pref_names.h" #include "components/user_prefs/pref_registry_syncable.h" +#include "extensions/browser/pref_names.h" void RegisterBrowserActionsControllerProfilePrefs( user_prefs::PrefRegistrySyncable* registry) { registry->RegisterDoublePref( - prefs::kBrowserActionContainerWidth, + extensions::pref_names::kBrowserActionContainerWidth, 0, user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); } diff --git a/chrome/browser/ui/views/toolbar/browser_actions_container.cc b/chrome/browser/ui/views/toolbar/browser_actions_container.cc index 7827bf4..bc92847 100644 --- a/chrome/browser/ui/views/toolbar/browser_actions_container.cc +++ b/chrome/browser/ui/views/toolbar/browser_actions_container.cc @@ -24,6 +24,7 @@ #include "chrome/browser/ui/views/toolbar/browser_action_view.h" #include "chrome/browser/ui/views/toolbar/toolbar_view.h" #include "chrome/common/pref_names.h" +#include "extensions/browser/pref_names.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "grit/ui_resources.h" @@ -117,11 +118,12 @@ void BrowserActionsContainer::Init() { // We wait to set the container width until now so that the chevron images // will be loaded. The width calculation needs to know the chevron size. if (model_ && - !profile_->GetPrefs()->HasPrefPath(prefs::kExtensionToolbarSize)) { + !profile_->GetPrefs()->HasPrefPath( + extensions::pref_names::kToolbarSize)) { // Migration code to the new VisibleIconCount pref. // TODO(mpcomplete): remove this after users are upgraded to 5.0. - int predefined_width = - profile_->GetPrefs()->GetInteger(prefs::kBrowserActionContainerWidth); + int predefined_width = profile_->GetPrefs()->GetInteger( + extensions::pref_names::kBrowserActionContainerWidth); if (predefined_width != 0) model_->SetVisibleIconCount(WidthToIconCount(predefined_width)); } diff --git a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc index e53b97e..6816006 100644 --- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc +++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc @@ -73,6 +73,7 @@ #include "extensions/browser/extension_registry.h" #include "extensions/browser/lazy_background_task_queue.h" #include "extensions/browser/management_policy.h" +#include "extensions/browser/pref_names.h" #include "extensions/browser/view_type_utils.h" #include "extensions/common/constants.h" #include "extensions/common/extension.h" @@ -1101,7 +1102,7 @@ void ExtensionSettingsHandler::MaybeRegisterForNotifications() { AsWeakPtr()); pref_registrar_.Init(profile->GetPrefs()); - pref_registrar_.Add(prefs::kExtensionInstallDenyList, callback); + pref_registrar_.Add(pref_names::kInstallDenyList, callback); } std::vector<ExtensionPage> diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc index cada323..43e59c4 100644 --- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc +++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc @@ -50,6 +50,7 @@ #include "extensions/browser/app_sorting.h" #include "extensions/browser/extension_registry.h" #include "extensions/browser/management_policy.h" +#include "extensions/browser/pref_names.h" #include "extensions/common/constants.h" #include "extensions/common/extension.h" #include "extensions/common/extension_set.h" @@ -464,7 +465,8 @@ void AppLauncherHandler::HandleGetApps(const base::ListValue* args) { base::Unretained(this)); extension_pref_change_registrar_.Init( extension_service_->extension_prefs()->pref_service()); - extension_pref_change_registrar_.Add(prefs::kExtensionsPref, callback); + extension_pref_change_registrar_.Add( + extensions::pref_names::kExtensions, callback); extension_pref_change_registrar_.Add(prefs::kNtpAppPageNames, callback); registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc index 2afbc43..712e2f8 100644 --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc @@ -944,21 +944,10 @@ const char kCurrentThemeDisplayProperties[] = "extensions.theme.properties"; // (showing developer packing tools and extensions details) const char kExtensionsUIDeveloperMode[] = "extensions.ui.developer_mode"; -// Integer pref that tracks the number of browser actions visible in the browser -// actions toolbar. -const char kExtensionToolbarSize[] = "extensions.toolbarsize"; - -// A preference that tracks browser action toolbar configuration. This is a list -// object stored in the Preferences file. The extensions are stored by ID. -const char kExtensionToolbar[] = "extensions.toolbar"; - // Dictionary pref that tracks which command belongs to which // extension + named command pair. const char kExtensionCommands[] = "extensions.commands"; -// A list of known disabled extensions IDs. -const char kExtensionKnownDisabled[] = "extensions.known_disabled"; - // Pref containing the directory for internal plugins as written to the plugins // list (below). const char kPluginsLastInternalDirectory[] = "plugins.last_internal_directory"; @@ -1272,14 +1261,6 @@ extern const char kWelcomeNotificationDismissed[] = extern const char kWelcomeNotificationPreviouslyPoppedUp[] = "message_center.welcome_notification_previously_popped_up"; -// Dictionary pref that keeps track of per-extension settings. The keys are -// extension ids. -const char kExtensionsPref[] = "extensions.settings"; - -// String pref for what version chrome was last time the extension prefs were -// loaded. -const char kExtensionsLastChromeVersion[] = "extensions.last_chrome_version"; - // Boolean pref that determines whether the user can enter fullscreen mode. // Disabling fullscreen mode also makes kiosk mode unavailable on desktop // platforms. @@ -1299,10 +1280,6 @@ const char kProfileResetPromptMemento[] = "profile.reset_prompt_memento"; const char kGCMUserAccountID[] = "gcm.user.account_id"; const char kGCMUserToken[] = "gcm.user.token"; -// Whitelist of Native Messaging Hosts. -const char kNativeMessagingBlacklist[] = "native_messaging.blacklist"; -const char kNativeMessagingWhitelist[] = "native_messaging.whitelist"; - // *************** LOCAL STATE *************** // These are attached to the machine/installation @@ -1694,54 +1671,6 @@ const char kDisableExtensions[] = "extensions.disabled"; // Whether the plugin finder that lets you install missing plug-ins is enabled. const char kDisablePluginFinder[] = "plugins.disable_plugin_finder"; -// Integer boolean representing the width (in pixels) of the container for -// browser actions. -const char kBrowserActionContainerWidth[] = - "extensions.browseractions.container.width"; - -// Time of the last, and next scheduled, extensions auto-update checks. -const char kLastExtensionsUpdateCheck[] = "extensions.autoupdate.last_check"; -const char kNextExtensionsUpdateCheck[] = "extensions.autoupdate.next_check"; - -// Whether we have run the extension-alert system (see ExtensionGlobalError) -// at least once for this profile. -const char kExtensionAlertsInitializedPref[] = "extensions.alerts.initialized"; - -// The sites that are allowed to install extensions. These sites should be -// allowed to install extensions without the scary dangerous downloads bar. -// Also, when off-store-extension installs are disabled, these sites are exempt. -const char kExtensionAllowedInstallSites[] = "extensions.allowed_install_sites"; - -// A list of allowed extension types. Extensions can only be installed if their -// type is on this whitelist or alternatively on kExtensionInstallAllowList or -// kExtensionInstallForceList. -const char kExtensionAllowedTypes[] = "extensions.allowed_types"; - -// Version number of last blacklist check. -const char kExtensionBlacklistUpdateVersion[] = - "extensions.blacklistupdate.version"; - -// A whitelist of extension ids the user can install: exceptions from the -// following blacklist. -const char kExtensionInstallAllowList[] = "extensions.install.allowlist"; - -// A blacklist, containing extensions the user cannot install. This list can -// contain "*" meaning all extensions. This list should not be confused with the -// extension blacklist, which is Google controlled. -const char kExtensionInstallDenyList[] = "extensions.install.denylist"; - -// A list containing extensions that Chrome will silently install -// at startup time. It is a list of strings, each string contains -// an extension ID and an update URL, delimited by a semicolon. -// This preference is set by an admin policy, and meant to be only -// accessed through extensions::ExternalPolicyProvider. -const char kExtensionInstallForceList[] = "extensions.install.forcelist"; - -// Indicates on-disk data might have skeletal data that needs to be cleaned -// on the next start of the browser. -const char kExtensionStorageGarbageCollect[] = - "extensions.storage.garbagecollect"; - // Customized app page names that appear on the New Tab Page. const char kNtpAppPageNames[] = "ntp.app_page_names"; diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h index 78db1cb..44096a3 100644 --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h @@ -308,10 +308,7 @@ extern const char kCurrentThemeColors[]; extern const char kCurrentThemeTints[]; extern const char kCurrentThemeDisplayProperties[]; extern const char kExtensionsUIDeveloperMode[]; -extern const char kExtensionToolbarSize[]; -extern const char kExtensionToolbar[]; extern const char kExtensionCommands[]; -extern const char kExtensionKnownDisabled[]; extern const char kPluginsLastInternalDirectory[]; extern const char kPluginsPluginsList[]; extern const char kPluginsDisabledPlugins[]; @@ -398,9 +395,6 @@ extern const char kSyncedNotificationFirstRun[]; extern const char kWelcomeNotificationDismissed[]; extern const char kWelcomeNotificationPreviouslyPoppedUp[]; -extern const char kExtensionsPref[]; -extern const char kExtensionsLastChromeVersion[]; - extern const char kFullscreenAllowed[]; extern const char kLocalDiscoveryNotificationsEnabled[]; @@ -410,9 +404,6 @@ extern const char kProfileResetPromptMemento[]; extern const char kGCMUserAccountID[]; extern const char kGCMUserToken[]; -extern const char kNativeMessagingBlacklist[]; -extern const char kNativeMessagingWhitelist[]; - // Local state prefs. Please add Profile prefs above instead. extern const char kCertRevocationCheckingEnabled[]; extern const char kCertRevocationCheckingRequiredLocalAnchors[]; @@ -560,19 +551,6 @@ extern const char kDisableVideoAndChat[]; extern const char kDisableExtensions[]; extern const char kDisablePluginFinder[]; -extern const char kBrowserActionContainerWidth[]; - -extern const char kLastExtensionsUpdateCheck[]; -extern const char kNextExtensionsUpdateCheck[]; - -extern const char kExtensionAlertsInitializedPref[]; -extern const char kExtensionAllowedInstallSites[]; -extern const char kExtensionAllowedTypes[]; -extern const char kExtensionBlacklistUpdateVersion[]; -extern const char kExtensionInstallAllowList[]; -extern const char kExtensionInstallDenyList[]; -extern const char kExtensionInstallForceList[]; -extern const char kExtensionStorageGarbageCollect[]; extern const char kNtpAppPageNames[]; extern const char kNtpCollapsedForeignSessions[]; diff --git a/extensions/browser/pref_names.cc b/extensions/browser/pref_names.cc index 56de339..be9a6b0 100644 --- a/extensions/browser/pref_names.cc +++ b/extensions/browser/pref_names.cc @@ -27,6 +27,25 @@ bool ScopeToPrefName(ExtensionPrefsScope scope, std::string* result) { return false; } +const char kAlertsInitialized[] = "extensions.alerts.initialized"; +const char kAllowedInstallSites[] = "extensions.allowed_install_sites"; +const char kAllowedTypes[] = "extensions.allowed_types"; +const char kBrowserActionContainerWidth[] = + "extensions.browseractions.container.width"; +const char kExtensions[] = "extensions.settings"; +const char kInstallAllowList[] = "extensions.install.allowlist"; +const char kInstallDenyList[] = "extensions.install.denylist"; +const char kInstallForceList[] = "extensions.install.forcelist"; +const char kKnownDisabled[] = "extensions.known_disabled"; +const char kLastChromeVersion[] = "extensions.last_chrome_version"; +const char kLastUpdateCheck[] = "extensions.autoupdate.last_check"; +const char kNativeMessagingBlacklist[] = "native_messaging.blacklist"; +const char kNativeMessagingWhitelist[] = "native_messaging.whitelist"; +const char kNextUpdateCheck[] = "extensions.autoupdate.next_check"; +const char kStorageGarbageCollect[] = "extensions.storage.garbagecollect"; +const char kToolbar[] = "extensions.toolbar"; +const char kToolbarSize[] = "extensions.toolbarsize"; + const char kPrefPreferences[] = "preferences"; const char kPrefIncognitoPreferences[] = "incognito_preferences"; const char kPrefRegularOnlyPreferences[] = "regular_only_preferences"; diff --git a/extensions/browser/pref_names.h b/extensions/browser/pref_names.h index f70b525..ed397a0 100644 --- a/extensions/browser/pref_names.h +++ b/extensions/browser/pref_names.h @@ -9,34 +9,104 @@ #include "extensions/browser/extension_prefs_scope.h" -namespace extensions { - // Preference keys which are needed by both the ExtensionPrefs and by external // clients, such as APIs. + +namespace extensions { namespace pref_names { // If the given |scope| is persisted, return true and populate |result| with the -// appropriate pref name. If |scope| is not persisted, return false, and leave -// |result| unchanged. +// appropriate property (i.e. one of kPref*) within a kExtensions dictionary. If +// |scope| is not persisted, return false, and leave |result| unchanged. bool ScopeToPrefName(ExtensionPrefsScope scope, std::string* result); -// A preference that contains any extension-controlled preferences. +// Browser-level preferences --------------------------------------------------- + +// Whether we have run the extension-alert system (see ExtensionGlobalError) +// at least once for this profile. +extern const char kAlertsInitialized[]; + +// The sites that are allowed to install extensions. These sites should be +// allowed to install extensions without the scary dangerous downloads bar. +// Also, when off-store-extension installs are disabled, these sites are exempt. +extern const char kAllowedInstallSites[]; + +// A list of allowed extension types. Extensions can only be installed if their +// type is on this whitelist or alternatively on kInstallAllowList or +// kInstallForceList. +extern const char kAllowedTypes[]; + +// Integer boolean representing the width (in pixels) of the container for +// browser actions. +extern const char kBrowserActionContainerWidth[]; + +// Dictionary pref that keeps track of per-extension settings. The keys are +// extension ids. +extern const char kExtensions[]; + +// A whitelist of extension ids the user can install: exceptions from the +// following blacklist. +extern const char kInstallAllowList[]; + +// A blacklist, containing extensions the user cannot install. This list can +// contain "*" meaning all extensions. This list should not be confused with the +// extension blacklist, which is Google controlled. +extern const char kInstallDenyList[]; + +// A list containing extensions that Chrome will silently install +// at startup time. It is a list of strings, each string contains +// an extension ID and an update URL, delimited by a semicolon. +// This preference is set by an admin policy, and meant to be only +// accessed through extensions::ExternalPolicyProvider. +extern const char kInstallForceList[]; + +// A list of known disabled extensions IDs. +extern const char kKnownDisabled[]; + +// String pref for what version chrome was last time the extension prefs were +// loaded. +extern const char kLastChromeVersion[]; + +// Time of the last extensions auto-update check. +extern const char kLastUpdateCheck[]; + +// Blacklist and whitelist for Native Messaging Hosts. +extern const char kNativeMessagingBlacklist[]; +extern const char kNativeMessagingWhitelist[]; + +// Time of the next scheduled extensions auto-update checks. +extern const char kNextUpdateCheck[]; + +// Indicates on-disk data might have skeletal data that needs to be cleaned +// on the next start of the browser. +extern const char kStorageGarbageCollect[]; + +// A preference that tracks browser action toolbar configuration. This is a list +// object stored in the Preferences file. The extensions are stored by ID. +extern const char kToolbar[]; + +// Integer pref that tracks the number of browser actions visible in the browser +// actions toolbar. +extern const char kToolbarSize[]; + +// Properties in kExtensions dictionaries -------------------------------------- + +// Extension-controlled preferences. extern const char kPrefPreferences[]; -// A preference that contains any extension-controlled incognito preferences. +// Extension-controlled incognito preferences. extern const char kPrefIncognitoPreferences[]; -// A preference that contains any extension-controlled regular-only preferences. +// Extension-controlled regular-only preferences. extern const char kPrefRegularOnlyPreferences[]; -// A preference that contains extension-set content settings. +// Extension-set content settings. extern const char kPrefContentSettings[]; -// A preference that contains extension-set content settings. +// Extension-set incognito content settings. extern const char kPrefIncognitoContentSettings[]; } // namespace pref_names - } // namespace extensions #endif // EXTENSIONS_BROWSER_PREF_NAMES_H_ diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 65c2a59..f62191f 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml @@ -30985,14 +30985,14 @@ other types of suffix sets. <int value="2" label="prefs::kHomePage"/> <int value="3" label="prefs::kRestoreOnStartup"/> <int value="4" label="prefs::kURLsToRestoreOnStartup"/> - <int value="5" label="prefs::kExtensionsPref"/> + <int value="5" label="extensions::pref_names::kExtensions"/> <int value="6" label="prefs::kGoogleServicesLastUsername"/> <int value="7" label="prefs::kSearchProviderOverrides"/> <int value="8" label="prefs::kDefaultSearchProviderSearchURL"/> <int value="9" label="prefs::kDefaultSearchProviderKeyword"/> <int value="10" label="prefs::kDefaultSearchProviderName"/> <int value="11" label="prefs::kPinnedTabs"/> - <int value="12" label="prefs::kExtensionKnownDisabled"/> + <int value="12" label="extensions::pref_names::kKnownDisabled"/> <int value="13" label="prefs::kProfileResetPromptMemento"/> </enum> |