| 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 "base/base_paths_win.h" | 5 #include "base/base_paths_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <shlobj.h> | 8 #include <shlobj.h> |
| 9 | 9 |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 break; | 95 break; |
| 96 case base::DIR_LOCAL_APP_DATA: | 96 case base::DIR_LOCAL_APP_DATA: |
| 97 if (FAILED(SHGetFolderPath(NULL, CSIDL_LOCAL_APPDATA, NULL, | 97 if (FAILED(SHGetFolderPath(NULL, CSIDL_LOCAL_APPDATA, NULL, |
| 98 SHGFP_TYPE_CURRENT, system_buffer))) | 98 SHGFP_TYPE_CURRENT, system_buffer))) |
| 99 return false; | 99 return false; |
| 100 cur = FilePath(system_buffer); | 100 cur = FilePath(system_buffer); |
| 101 break; | 101 break; |
| 102 case base::DIR_SOURCE_ROOT: | 102 case base::DIR_SOURCE_ROOT: |
| 103 // On Windows, unit tests execute two levels deep from the source root. | 103 // On Windows, unit tests execute two levels deep from the source root. |
| 104 // For example: chrome/{Debug|Release}/ui_tests.exe | 104 // For example: chrome/{Debug|Release}/ui_tests.exe |
| 105 PathService::Get(base::DIR_EXE, &wstring_path); | 105 PathService::Get(base::DIR_EXE, &cur); |
| 106 file_util::UpOneDirectory(&wstring_path); | 106 cur = cur.DirName().DirName(); |
| 107 file_util::UpOneDirectory(&wstring_path); | |
| 108 cur = FilePath(wstring_path); | |
| 109 break; | 107 break; |
| 110 default: | 108 default: |
| 111 return false; | 109 return false; |
| 112 } | 110 } |
| 113 | 111 |
| 114 *result = cur; | 112 *result = cur; |
| 115 return true; | 113 return true; |
| 116 } | 114 } |
| 117 | 115 |
| 118 } // namespace base | 116 } // namespace base |
| OLD | NEW |