summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/extensions/api/file_system/file_system_api.cc13
-rw-r--r--chrome/browser/extensions/api/file_system/file_system_apitest.cc15
2 files changed, 4 insertions, 24 deletions
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 291cb09..1009c84 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
};
diff --git a/chrome/browser/extensions/api/file_system/file_system_apitest.cc b/chrome/browser/extensions/api/file_system/file_system_apitest.cc
index c878709..e8e1d71 100644
--- a/chrome/browser/extensions/api/file_system/file_system_apitest.cc
+++ b/chrome/browser/extensions/api/file_system/file_system_apitest.cc
@@ -57,13 +57,7 @@ void AddSavedEntry(const base::FilePath& path_to_save,
extension->id(), "magic id", path_to_save, is_directory);
}
-#if defined(OS_WIN) || defined(OS_POSIX)
-#if defined(OS_WIN)
- const int kGraylistedPath = base::DIR_PROFILE;
-#elif defined(OS_POSIX)
- const int kGraylistedPath = base::DIR_HOME;
-#endif
-#endif
+const int kGraylistedPath = base::DIR_HOME;
} // namespace
@@ -157,12 +151,7 @@ IN_PROC_BROWSER_TEST_F(FileSystemApiTest, FileSystemApiGetDisplayPath) {
#if defined(OS_WIN) || defined(OS_POSIX)
IN_PROC_BROWSER_TEST_F(FileSystemApiTest, FileSystemApiGetDisplayPathPrettify) {
-#if defined(OS_WIN)
- int override = base::DIR_PROFILE;
-#elif defined(OS_POSIX)
- int override = base::DIR_HOME;
-#endif
- ASSERT_TRUE(PathService::OverrideAndCreateIfNeeded(override,
+ ASSERT_TRUE(PathService::OverrideAndCreateIfNeeded(base::DIR_HOME,
test_root_folder_, false));
base::FilePath test_file = test_root_folder_.AppendASCII("gold.txt");