OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <windows.h> | 5 #include <windows.h> |
6 #include <shlobj.h> | 6 #include <shlobj.h> |
7 | 7 |
8 #include "base/base_paths.h" | 8 #include "base/base_paths.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 system_buffer))) | 88 system_buffer))) |
89 return false; | 89 return false; |
90 cur = FilePath(system_buffer); | 90 cur = FilePath(system_buffer); |
91 break; | 91 break; |
92 case base::DIR_COMMON_APP_DATA: | 92 case base::DIR_COMMON_APP_DATA: |
93 if (FAILED(SHGetFolderPath(NULL, CSIDL_COMMON_APPDATA, NULL, | 93 if (FAILED(SHGetFolderPath(NULL, CSIDL_COMMON_APPDATA, NULL, |
94 SHGFP_TYPE_CURRENT, system_buffer))) | 94 SHGFP_TYPE_CURRENT, system_buffer))) |
95 return false; | 95 return false; |
96 cur = FilePath(system_buffer); | 96 cur = FilePath(system_buffer); |
97 break; | 97 break; |
98 case base::DIR_LOCAL_APP_DATA_LOW: | |
99 if (win::GetVersion() < win::VERSION_VISTA) | |
100 return false; | |
101 | |
102 // TODO(nsylvain): We should use SHGetKnownFolderPath instead. Bug 1281128 | |
103 if (FAILED(SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, | |
104 system_buffer))) | |
105 return false; | |
106 cur = FilePath(system_buffer).DirName().AppendASCII("LocalLow"); | |
107 break; | |
108 case base::DIR_LOCAL_APP_DATA: | 98 case base::DIR_LOCAL_APP_DATA: |
109 if (FAILED(SHGetFolderPath(NULL, CSIDL_LOCAL_APPDATA, NULL, | 99 if (FAILED(SHGetFolderPath(NULL, CSIDL_LOCAL_APPDATA, NULL, |
110 SHGFP_TYPE_CURRENT, system_buffer))) | 100 SHGFP_TYPE_CURRENT, system_buffer))) |
111 return false; | 101 return false; |
112 cur = FilePath(system_buffer); | 102 cur = FilePath(system_buffer); |
113 break; | 103 break; |
114 case base::DIR_SOURCE_ROOT: { | 104 case base::DIR_SOURCE_ROOT: { |
115 FilePath executableDir; | 105 FilePath executableDir; |
116 // On Windows, unit tests execute two levels deep from the source root. | 106 // On Windows, unit tests execute two levels deep from the source root. |
117 // For example: chrome/{Debug|Release}/ui_tests.exe | 107 // For example: chrome/{Debug|Release}/ui_tests.exe |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 break; | 163 break; |
174 default: | 164 default: |
175 return false; | 165 return false; |
176 } | 166 } |
177 | 167 |
178 *result = cur; | 168 *result = cur; |
179 return true; | 169 return true; |
180 } | 170 } |
181 | 171 |
182 } // namespace base | 172 } // namespace base |
OLD | NEW |