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

Unified Diff: base/chromeos/chromeos_version.cc

Issue 10843041: Add OS_CHROMEOS case in file_util::GetHomeDir() (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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/chromeos/chromeos_version.h ('k') | chrome/browser/chromeos/gdata/gdata_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/chromeos/chromeos_version.cc
diff --git a/base/chromeos/chromeos_version.cc b/base/chromeos/chromeos_version.cc
index 4a70cd5312aad80213e9eb3cdd7c9e6ec420411b..138d98384e1b2e4a8e652ce0e5aa560ef9ec3de3 100644
--- a/base/chromeos/chromeos_version.cc
+++ b/base/chromeos/chromeos_version.cc
@@ -20,5 +20,17 @@ bool IsRunningOnChromeOS() {
return user && strcmp(user, "chronos") == 0;
}
+// Returns the home directory path, or an empty string if the home directory
+// is not found.
satorux1 2012/08/02 06:09:57 Please remove the comment. we shouldn't repeat her
Haruki Sato 2012/08/02 06:44:13 Done. Thanks.
+std::string GetHomeDirectory() {
+ if (base::chromeos::IsRunningOnChromeOS())
satorux1 2012/08/02 06:09:57 remove base::chromeos::
Haruki Sato 2012/08/02 06:44:13 Done. Thanks.
+ return "/home/chronos/user";
+
+ const char* home = getenv("HOME");
+ if (home)
+ return home;
+ return "";
+}
+
} // namespace chromeos
} // namespace base
« no previous file with comments | « base/chromeos/chromeos_version.h ('k') | chrome/browser/chromeos/gdata/gdata_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698