diff options
author | skerner@google.com <skerner@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-22 14:47:18 +0000 |
---|---|---|
committer | skerner@google.com <skerner@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-22 14:47:18 +0000 |
commit | 73e4c36f363107b3b625001ebf524ca247c5220c (patch) | |
tree | aeafb62d03121d1881aa36180d7dcab6e047a990 /chrome/common/chrome_paths.cc | |
parent | e4d9c1fb00637f609fb81e00c8e5be5d3c1c8230 (diff) | |
download | chromium_src-73e4c36f363107b3b625001ebf524ca247c5220c.zip chromium_src-73e4c36f363107b3b625001ebf524ca247c5220c.tar.gz chromium_src-73e4c36f363107b3b625001ebf524ca247c5220c.tar.bz2 |
Add external extensions json source in proper mac location.
The old path will be deprecated once developers have migrated.
BUG=67203
TEST=FileUtilTest.IsPathControledByAdmin
Review URL: http://codereview.chromium.org/7718021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102274 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/chrome_paths.cc')
-rw-r--r-- | chrome/common/chrome_paths.cc | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc index db1f2b5..3b3260f 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; } |