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

Unified Diff: chrome/common/chrome_paths.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/common/chrome_paths.cc
diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc
index db1f2b5c9dd465f4f636da3cf63eb257104c3709..3b3260f1e64f9567ba1b49b99b5bc614928850ee 100644
--- a/chrome/common/chrome_paths.cc
+++ b/chrome/common/chrome_paths.cc
@@ -334,16 +334,12 @@ bool PathProvider(int key, FilePath* result) {
#endif
case chrome::DIR_EXTERNAL_EXTENSIONS:
#if defined(OS_MACOSX)
- if (!PathService::Get(base::DIR_EXE, &cur))
+ if (!chrome::GetGlobalApplicationSupportDirectory(&cur))
return false;
- // On Mac, built-in extensions are in Contents/Extensions, a sibling of
- // the App dir. If there are none, it may not exist.
- // TODO(skerner): Reading external extensions from a file inside the
- // app budle causes several problems. Change this path to be outside
- // the app bundle. crbug/67203
- cur = cur.DirName();
- cur = cur.Append(FILE_PATH_LITERAL("Extensions"));
+ cur = cur.Append(FILE_PATH_LITERAL("Google"))
+ .Append(FILE_PATH_LITERAL("Chrome"))
+ .Append(FILE_PATH_LITERAL("External Extensions"));
create_dir = false;
#else
if (!PathService::Get(base::DIR_MODULE, &cur))
@@ -353,6 +349,22 @@ bool PathProvider(int key, FilePath* result) {
create_dir = true;
#endif
break;
+
+#if defined(OS_MACOSX)
+ case DIR_DEPRICATED_EXTERNAL_EXTENSIONS:
+ // TODO(skerner): Reading external extensions from a file inside the
+ // app budle causes several problems. Once users have a chance to
+ // migrate, remove this path. crbug/67203
+ if (!PathService::Get(base::DIR_EXE, &cur))
+ return false;
+
+ cur = cur.DirName();
+ cur = cur.Append(FILE_PATH_LITERAL("Extensions"));
+ create_dir = false;
+
+ break;
+#endif
+
case chrome::DIR_DEFAULT_APPS:
#if defined(OS_MACOSX)
cur = base::mac::MainAppBundlePath();
@@ -363,6 +375,7 @@ bool PathProvider(int key, FilePath* result) {
cur = cur.Append(FILE_PATH_LITERAL("default_apps"));
#endif
break;
+
default:
return false;
}

Powered by Google App Engine
This is Rietveld 408576698