Index: base/file_util_win.cc |
diff --git a/base/file_util_win.cc b/base/file_util_win.cc |
index b2f69c85ae1d81db757646b16828984d08d8aaef..d42ffac1f032ad6a844bfa5e87412d2d1628091f 100644 |
--- a/base/file_util_win.cc |
+++ b/base/file_util_win.cc |
@@ -258,6 +258,22 @@ bool GetShmemTempDir(bool executable, FilePath* path) { |
return GetTempDir(path); |
} |
+FilePath GetHomeDir() { |
+ char16 result[MAX_PATH]; |
+ if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PROFILE, NULL, SHGFP_TYPE_CURRENT, |
+ result)) && |
+ result[0]) |
+ return FilePath(result); |
benwells
2014/02/18 23:14:40
Nit: curlies around block as if spans multiple lin
|
+ |
+ // Fall back to the temporary directory on failure. |
+ FilePath temp; |
+ if (GetTempDir(&temp)) |
+ return temp; |
+ |
+ // Last resort. |
+ return FilePath(L"C:\\"); |
+} |
+ |
bool CreateTemporaryFile(FilePath* path) { |
ThreadRestrictions::AssertIOAllowed(); |