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

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: review comments 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
« no previous file with comments | « base/path_service_unittest.cc ('k') | chrome/browser/extensions/api/file_system/file_system_apitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 291cb090403ecb481396843bf625c1a6279b0053..1009c848ba7a7b1e229bcbcd71040da0c608c79d 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
};
« no previous file with comments | « base/path_service_unittest.cc ('k') | chrome/browser/extensions/api/file_system/file_system_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698