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

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

Issue 10700136: Prettify output from chrome.fileSystem.getDisplayPath for POSIX profile directories (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Includes specific fix for Mac OS X, which was excluded from the posix code specifically Created 8 years, 5 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/file_util_posix.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 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;
}
« no previous file with comments | « base/file_util_posix.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