| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 SHGFP_TYPE_CURRENT, system_buffer))) | 110 SHGFP_TYPE_CURRENT, system_buffer))) |
| 111 return false; | 111 return false; |
| 112 cur = FilePath(system_buffer); | 112 cur = FilePath(system_buffer); |
| 113 break; | 113 break; |
| 114 case base::DIR_SOURCE_ROOT: { | 114 case base::DIR_SOURCE_ROOT: { |
| 115 FilePath executableDir; | 115 FilePath executableDir; |
| 116 // On Windows, unit tests execute two levels deep from the source root. | 116 // On Windows, unit tests execute two levels deep from the source root. |
| 117 // For example: chrome/{Debug|Release}/ui_tests.exe | 117 // For example: chrome/{Debug|Release}/ui_tests.exe |
| 118 PathService::Get(base::DIR_EXE, &executableDir); | 118 PathService::Get(base::DIR_EXE, &executableDir); |
| 119 cur = executableDir.DirName().DirName(); | 119 cur = executableDir.DirName().DirName(); |
| 120 FilePath checkedPath = | |
| 121 cur.Append(FILE_PATH_LITERAL("base/base_paths_win.cc")); | |
| 122 if (!file_util::PathExists(checkedPath)) { | |
| 123 // Check for WebKit-only checkout. Executable files are put into | |
| 124 // WebKit/WebKit/chromium/{Debug|Relese}, and we should return | |
| 125 // WebKit/WebKit/chromium. | |
| 126 cur = executableDir.DirName(); | |
| 127 } | |
| 128 break; | 120 break; |
| 129 } | 121 } |
| 130 default: | 122 default: |
| 131 return false; | 123 return false; |
| 132 } | 124 } |
| 133 | 125 |
| 134 *result = cur; | 126 *result = cur; |
| 135 return true; | 127 return true; |
| 136 } | 128 } |
| 137 | 129 |
| 138 } // namespace base | 130 } // namespace base |
| OLD | NEW |