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

Unified Diff: chrome/browser/extensions/api/file_system/file_system_api.cc

Issue 159833003: Add support for GetHomeDir for Mac and Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git try Created 6 years, 10 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/api/file_system/file_system_api.cc
diff --git a/chrome/browser/extensions/api/file_system/file_system_api.cc b/chrome/browser/extensions/api/file_system/file_system_api.cc
index 81db0203da17c792c8a13d5e8769901e9218b1e2..45451d29efddb668fcd913256414f50a560aa267 100644
--- a/chrome/browser/extensions/api/file_system/file_system_api.cc
+++ b/chrome/browser/extensions/api/file_system/file_system_api.cc
@@ -128,18 +128,11 @@ base::FilePath PrettifyPath(const base::FilePath& source_path) {
// Prettifies |source_path|, by replacing the user's home directory with "~"
// (if applicable).
base::FilePath PrettifyPath(const base::FilePath& source_path) {
-#if defined(OS_WIN) || defined(OS_POSIX)
-#if defined(OS_WIN)
- int home_key = base::DIR_PROFILE;
-#elif defined(OS_POSIX)
- int home_key = base::DIR_HOME;
-#endif
base::FilePath home_path;
base::FilePath display_path = base::FilePath::FromUTF8Unsafe("~");
- if (PathService::Get(home_key, &home_path)
+ if (PathService::Get(base::DIR_HOME, &home_path)
&& home_path.AppendRelativePath(source_path, &display_path))
return display_path;
-#endif
return source_path;
}
#endif // defined(OS_MACOSX)
@@ -219,13 +212,11 @@ bool GetFileTypesFromAcceptOption(
const char kLastChooseEntryDirectory[] = "last_choose_file_directory";
const int kGraylistedPaths[] = {
+ base::DIR_HOME,
#if defined(OS_WIN)
- base::DIR_PROFILE,
base::DIR_PROGRAM_FILES,
base::DIR_PROGRAM_FILESX86,
base::DIR_WINDOWS,
-#elif defined(OS_POSIX)
- base::DIR_HOME,
#endif
};

Powered by Google App Engine
This is Rietveld 408576698