diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-27 01:27:19 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-27 01:27:19 +0000 |
commit | 2438b1729d34840ed380ce1ef4f37f3f56faa5e7 (patch) | |
tree | 9f631c1af54409bc0fa13eb6e1743f0a0c3c9fe5 /base/mac_util.h | |
parent | c80f9b0e650db3addaa0217be50da5bebd323cc3 (diff) | |
download | chromium_src-2438b1729d34840ed380ce1ef4f37f3f56faa5e7.zip chromium_src-2438b1729d34840ed380ce1ef4f37f3f56faa5e7.tar.gz chromium_src-2438b1729d34840ed380ce1ef4f37f3f56faa5e7.tar.bz2 |
Moved GetUserDirectory() into mac_util.mm.
Made mac_util.mm and chrome_paths_mac.mm use GetUserDirectory().
Made firefox_importer_utils_mac.mm use PathService.
Added unittests for GetUserDirectory().
BUG=22045
TEST=trybots
Review URL: http://codereview.chromium.org/548123
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37206 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/mac_util.h')
-rw-r--r-- | base/mac_util.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/base/mac_util.h b/base/mac_util.h index 7b697c9..8628e6c 100644 --- a/base/mac_util.h +++ b/base/mac_util.h @@ -19,6 +19,13 @@ class NSBundle; class NSWindow; #endif +// Adapted from NSPathUtilities.h and NSObjCRuntime.h. +#if __LP64__ || NS_BUILD_32_LIKE_64 +typedef unsigned long NSSearchPathDirectory; +#else +typedef unsigned int NSSearchPathDirectory; +#endif + namespace mac_util { std::string PathFromFSRef(const FSRef& ref); @@ -52,6 +59,11 @@ OSType CreatorCodeForCFBundleRef(CFBundleRef bundle); // app bundle's creator code anyway. OSType CreatorCodeForApplication(); +// Searches for directories for the given key in only the user domain. +// If found, fills result (which must always be non-NULL) with the +// first found directory and returns true. Otherwise, returns false. +bool GetUserDirectory(NSSearchPathDirectory directory, FilePath* result); + // Returns the ~/Library directory. FilePath GetUserLibraryPath(); |