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

Side by Side Diff: base/mac/foundation_util.h

Issue 10823157: Prettify Mac names, rewrite getDisplayPath API call to focus on $HOME (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rewrite getDisplayPath to focus on home directories, adds better Mac support Created 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | base/mac/foundation_util.mm » ('j') | base/mac/foundation_util.mm » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_MAC_FOUNDATION_UTIL_H_ 5 #ifndef BASE_MAC_FOUNDATION_UTIL_H_
6 #define BASE_MAC_FOUNDATION_UTIL_H_ 6 #define BASE_MAC_FOUNDATION_UTIL_H_
7 7
8 #include <CoreFoundation/CoreFoundation.h> 8 #include <CoreFoundation/CoreFoundation.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 // first found directory and returns true. Otherwise, returns false. 78 // first found directory and returns true. Otherwise, returns false.
79 BASE_EXPORT bool GetLocalDirectory(NSSearchPathDirectory directory, 79 BASE_EXPORT bool GetLocalDirectory(NSSearchPathDirectory directory,
80 FilePath* result); 80 FilePath* result);
81 81
82 // Searches for directories for the given key in only the user domain. 82 // Searches for directories for the given key in only the user domain.
83 // If found, fills result (which must always be non-NULL) with the 83 // If found, fills result (which must always be non-NULL) with the
84 // first found directory and returns true. Otherwise, returns false. 84 // first found directory and returns true. Otherwise, returns false.
85 BASE_EXPORT bool GetUserDirectory(NSSearchPathDirectory directory, 85 BASE_EXPORT bool GetUserDirectory(NSSearchPathDirectory directory,
86 FilePath* result); 86 FilePath* result);
87 87
88 // Retrieves the localized display name for the given path. If the path is not
89 // localized, this will just retrieve the BaseName of the path.
90 BASE_EXPORT std::string GetDisplayNameForPath(const FilePath& path);
benwells 2012/09/04 04:15:01 Is this the display name for the whole path, or ju
thorogood 2012/09/04 05:57:33 Just the base name. I've updated the comment to cl
benwells 2012/09/04 06:38:11 More importantly can you change the name of the fu
thorogood 2012/09/04 06:45:43 I've changed it to GetDisplayBaseNameForPath.
91
88 // Returns the ~/Library directory. 92 // Returns the ~/Library directory.
89 BASE_EXPORT FilePath GetUserLibraryPath(); 93 BASE_EXPORT FilePath GetUserLibraryPath();
90 94
91 // Takes a path to an (executable) binary and tries to provide the path to an 95 // Takes a path to an (executable) binary and tries to provide the path to an
92 // application bundle containing it. It takes the outermost bundle that it can 96 // application bundle containing it. It takes the outermost bundle that it can
93 // find (so for "/Foo/Bar.app/.../Baz.app/..." it produces "/Foo/Bar.app"). 97 // find (so for "/Foo/Bar.app/.../Baz.app/..." it produces "/Foo/Bar.app").
94 // |exec_name| - path to the binary 98 // |exec_name| - path to the binary
95 // returns - path to the application bundle, or empty on error 99 // returns - path to the application bundle, or empty on error
96 BASE_EXPORT FilePath GetAppBundlePath(const FilePath& exec_name); 100 BASE_EXPORT FilePath GetAppBundlePath(const FilePath& exec_name);
97 101
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 // by using the NSToCFCast methods above. 349 // by using the NSToCFCast methods above.
346 // e.g. LOG(INFO) << base::mac::NSToCFCast(@"foo"); 350 // e.g. LOG(INFO) << base::mac::NSToCFCast(@"foo");
347 // Operator << can not be overloaded for ObjectiveC types as the compiler 351 // Operator << can not be overloaded for ObjectiveC types as the compiler
348 // can not distinguish between overloads for id with overloads for void*. 352 // can not distinguish between overloads for id with overloads for void*.
349 BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, 353 BASE_EXPORT extern std::ostream& operator<<(std::ostream& o,
350 const CFErrorRef err); 354 const CFErrorRef err);
351 BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, 355 BASE_EXPORT extern std::ostream& operator<<(std::ostream& o,
352 const CFStringRef str); 356 const CFStringRef str);
353 357
354 #endif // BASE_MAC_FOUNDATION_UTIL_H_ 358 #endif // BASE_MAC_FOUNDATION_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | base/mac/foundation_util.mm » ('j') | base/mac/foundation_util.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698