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 c3c71250251315d4ac4dcef171458bd5ac568ac0..eb20c11c664c083d42ddf839fe2100ff43944ae2 100644 |
--- a/chrome/browser/extensions/api/file_system/file_system_api.cc |
+++ b/chrome/browser/extensions/api/file_system/file_system_api.cc |
@@ -51,19 +51,14 @@ struct RewritePair { |
const RewritePair g_rewrite_pairs[] = { |
#if defined(OS_WIN) |
{base::DIR_PROFILE, "~"}, |
+#elif defined(OS_POSIX) |
+ {base::DIR_HOME, "~"}, |
#endif |
}; |
FilePath PrettifyPath(const FilePath& file_path) { |
- // Note that when g_rewrite_pairs includes at least one value on all |
- // platforms, this code can be cleaned up. |
-#if defined(OS_WIN) |
- size_t size = arraysize(g_rewrite_pairs); |
-#else |
- size_t size = 0; |
-#endif |
- |
- for (size_t i = 0; i < size; ++i) { |
+#if defined(OS_WIN) || defined(OS_POSIX) |
+ for (size_t i = 0; i < arraysize(g_rewrite_pairs); ++i) { |
FilePath candidate_path; |
if (!PathService::Get(g_rewrite_pairs[i].path_key, &candidate_path)) |
continue; // We don't DCHECK this value, as Get will return false even |
@@ -77,6 +72,7 @@ FilePath PrettifyPath(const FilePath& file_path) { |
return output; |
} |
} |
+#endif |
return file_path; |
} |