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

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

Issue 7718021: Add external extensions json source in proper mac location. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sss Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/external_extension_provider_impl.cc
diff --git a/chrome/browser/extensions/external_extension_provider_impl.cc b/chrome/browser/extensions/external_extension_provider_impl.cc
index f288af0e6ea4cc77d1d0f5f5bc01ff624855c046..2a61c58a8f18319f443ec21ebeda8df71244de08 100644
--- a/chrome/browser/extensions/external_extension_provider_impl.cc
+++ b/chrome/browser/extensions/external_extension_provider_impl.cc
@@ -222,14 +222,38 @@ void ExternalExtensionProviderImpl::CreateExternalProviders(
VisitorInterface* service,
Profile* profile,
ProviderCollection* provider_list) {
+
+ // On Mac OS, items in /Library/... should be written by the superuser.
+ // Check that all components of the path are writable by root only.
+ ExternalPrefExtensionLoader::Options options;
+#if defined(OS_MACOSX)
+ options = ExternalPrefExtensionLoader::ENSURE_PATH_CONTROLLED_BY_ADMIN;
+#else
+ options = ExternalPrefExtensionLoader::NONE;
+#endif
+
+ provider_list->push_back(
+ linked_ptr<ExternalExtensionProviderInterface>(
+ new ExternalExtensionProviderImpl(
+ service,
+ new ExternalPrefExtensionLoader(
+ chrome::DIR_EXTERNAL_EXTENSIONS, options),
+ Extension::EXTERNAL_PREF,
+ Extension::EXTERNAL_PREF_DOWNLOAD)));
+
+#if defined(OS_MACOSX)
+ // Support old path to external extensions file as we migrate to the
+ // new one. See crbug/67203.
provider_list->push_back(
linked_ptr<ExternalExtensionProviderInterface>(
new ExternalExtensionProviderImpl(
service,
new ExternalPrefExtensionLoader(
- chrome::DIR_EXTERNAL_EXTENSIONS),
+ chrome::DIR_DEPRICATED_EXTERNAL_EXTENSIONS,
+ ExternalPrefExtensionLoader::NONE),
Extension::EXTERNAL_PREF,
Extension::EXTERNAL_PREF_DOWNLOAD)));
+#endif
#if defined(OS_CHROMEOS)
// Chrome OS specific source for OEM customization.

Powered by Google App Engine
This is Rietveld 408576698