OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/common/chrome_paths_internal.h" | 5 #include "chrome/common/chrome_paths_internal.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <knownfolders.h> | 8 #include <knownfolders.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #include <shlobj.h> | 10 #include <shlobj.h> |
(...skipping 20 matching lines...) Expand all Loading... |
31 if (!PathService::Get(base::DIR_LOCAL_APP_DATA, result)) | 31 if (!PathService::Get(base::DIR_LOCAL_APP_DATA, result)) |
32 return false; | 32 return false; |
33 #if defined(GOOGLE_CHROME_BUILD) | 33 #if defined(GOOGLE_CHROME_BUILD) |
34 *result = result->Append(FILE_PATH_LITERAL("Google")); | 34 *result = result->Append(FILE_PATH_LITERAL("Google")); |
35 #endif | 35 #endif |
36 *result = result->Append(L"Chrome Frame"); | 36 *result = result->Append(L"Chrome Frame"); |
37 *result = result->Append(chrome::kUserDataDirname); | 37 *result = result->Append(chrome::kUserDataDirname); |
38 return true; | 38 return true; |
39 } | 39 } |
40 | 40 |
41 void GetUserCacheDirectory(const FilePath& profile_dir, FilePath* result) { | |
42 // This function does more complicated things on Mac/Linux. | |
43 *result = profile_dir; | |
44 } | |
45 | |
46 bool GetUserDocumentsDirectory(FilePath* result) { | 41 bool GetUserDocumentsDirectory(FilePath* result) { |
47 wchar_t path_buf[MAX_PATH]; | 42 wchar_t path_buf[MAX_PATH]; |
48 if (FAILED(SHGetFolderPath(NULL, CSIDL_MYDOCUMENTS, NULL, | 43 if (FAILED(SHGetFolderPath(NULL, CSIDL_MYDOCUMENTS, NULL, |
49 SHGFP_TYPE_CURRENT, path_buf))) | 44 SHGFP_TYPE_CURRENT, path_buf))) |
50 return false; | 45 return false; |
51 *result = FilePath(path_buf); | 46 *result = FilePath(path_buf); |
52 return true; | 47 return true; |
53 } | 48 } |
54 | 49 |
55 // Return a default path for downloads that is safe. | 50 // Return a default path for downloads that is safe. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 wchar_t system_buffer[MAX_PATH]; | 84 wchar_t system_buffer[MAX_PATH]; |
90 system_buffer[0] = 0; | 85 system_buffer[0] = 0; |
91 if (FAILED(SHGetFolderPath(NULL, CSIDL_DESKTOPDIRECTORY, NULL, | 86 if (FAILED(SHGetFolderPath(NULL, CSIDL_DESKTOPDIRECTORY, NULL, |
92 SHGFP_TYPE_CURRENT, system_buffer))) | 87 SHGFP_TYPE_CURRENT, system_buffer))) |
93 return false; | 88 return false; |
94 *result = FilePath(system_buffer); | 89 *result = FilePath(system_buffer); |
95 return true; | 90 return true; |
96 } | 91 } |
97 | 92 |
98 } // namespace chrome | 93 } // namespace chrome |
OLD | NEW |