Index: base/file_util_win.cc |
diff --git a/base/file_util_win.cc b/base/file_util_win.cc |
index b2f69c85ae1d81db757646b16828984d08d8aaef..e7aadc218c4a765ad921f70e0b47f7aa71296328 100644 |
--- a/base/file_util_win.cc |
+++ b/base/file_util_win.cc |
@@ -258,6 +258,23 @@ 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); |
+ } |
+ |
+ // 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(); |