OLD | NEW |
---|---|
1 // Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2010 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.h" | 5 #include "chrome/common/chrome_paths.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
161 case chrome::DIR_BOOKMARK_MANAGER: | 161 case chrome::DIR_BOOKMARK_MANAGER: |
162 if (!PathService::Get(chrome::DIR_RESOURCES, &cur)) | 162 if (!PathService::Get(chrome::DIR_RESOURCES, &cur)) |
163 return false; | 163 return false; |
164 cur = cur.Append(FILE_PATH_LITERAL("bookmark_manager")); | 164 cur = cur.Append(FILE_PATH_LITERAL("bookmark_manager")); |
165 break; | 165 break; |
166 case chrome::DIR_INSPECTOR: | 166 case chrome::DIR_INSPECTOR: |
167 if (!PathService::Get(chrome::DIR_RESOURCES, &cur)) | 167 if (!PathService::Get(chrome::DIR_RESOURCES, &cur)) |
168 return false; | 168 return false; |
169 cur = cur.Append(FILE_PATH_LITERAL("inspector")); | 169 cur = cur.Append(FILE_PATH_LITERAL("inspector")); |
170 break; | 170 break; |
171 case chrome::DIR_NET_INTERNALS: | |
172 if (!PathService::Get(chrome::DIR_RESOURCES, &cur)) | |
173 return false; | |
174 cur = cur.Append(FILE_PATH_LITERAL("net_internals")); | |
175 break; | |
176 case chrome::DIR_APP_DICTIONARIES: | 171 case chrome::DIR_APP_DICTIONARIES: |
177 #if defined(OS_LINUX) || defined(OS_MACOSX) | 172 #if defined(OS_LINUX) || defined(OS_MACOSX) |
178 // We can't write into the EXE dir on Linux, so keep dictionaries | 173 // We can't write into the EXE dir on Linux, so keep dictionaries |
179 // alongside the safe browsing database in the user data dir. | 174 // alongside the safe browsing database in the user data dir. |
180 // And we don't want to write into the bundle on the Mac, so push | 175 // And we don't want to write into the bundle on the Mac, so push |
181 // it to the user data dir there also. | 176 // it to the user data dir there also. |
182 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) | 177 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) |
183 return false; | 178 return false; |
184 #else | 179 #else |
185 if (!PathService::Get(base::DIR_EXE, &cur)) | 180 if (!PathService::Get(base::DIR_EXE, &cur)) |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
243 return false; | 238 return false; |
244 #if defined(OS_WIN) | 239 #if defined(OS_WIN) |
245 cur = cur.Append(FILE_PATH_LITERAL("pdf.dll")); | 240 cur = cur.Append(FILE_PATH_LITERAL("pdf.dll")); |
246 #elif defined(OS_MACOSX) | 241 #elif defined(OS_MACOSX) |
247 cur = cur.Append(FILE_PATH_LITERAL("PDF.plugin")); | 242 cur = cur.Append(FILE_PATH_LITERAL("PDF.plugin")); |
248 #else // Linux and Chrome OS | 243 #else // Linux and Chrome OS |
249 cur = cur.Append(FILE_PATH_LITERAL("libpdf.so")); | 244 cur = cur.Append(FILE_PATH_LITERAL("libpdf.so")); |
250 #endif | 245 #endif |
251 break; | 246 break; |
252 case chrome::FILE_RESOURCES_PACK: | 247 case chrome::FILE_RESOURCES_PACK: |
248 #if defined(OS_MACOSX) | |
249 cur = mac_util::MainAppBundlePath(); | |
250 cur = cur.Append(FILE_PATH_LITERAL("Resources")); | |
tony
2010/06/17 00:16:21
Ah yes, this looks right.
| |
251 #else // Linux/Windows/ChromeOS | |
253 if (!PathService::Get(base::DIR_EXE, &cur)) | 252 if (!PathService::Get(base::DIR_EXE, &cur)) |
254 return false; | 253 return false; |
254 #endif | |
255 cur = cur.Append(FILE_PATH_LITERAL("resources.pak")); | 255 cur = cur.Append(FILE_PATH_LITERAL("resources.pak")); |
256 break; | 256 break; |
257 #if defined(OS_CHROMEOS) | 257 #if defined(OS_CHROMEOS) |
258 case chrome::FILE_CHROMEOS_API: | 258 case chrome::FILE_CHROMEOS_API: |
259 if (!PathService::Get(base::DIR_MODULE, &cur)) | 259 if (!PathService::Get(base::DIR_MODULE, &cur)) |
260 return false; | 260 return false; |
261 cur = cur.Append(FILE_PATH_LITERAL("chromeos")); | 261 cur = cur.Append(FILE_PATH_LITERAL("chromeos")); |
262 cur = cur.Append(FILE_PATH_LITERAL("libcros.so")); | 262 cur = cur.Append(FILE_PATH_LITERAL("libcros.so")); |
263 break; | 263 break; |
264 #endif | 264 #endif |
(...skipping 30 matching lines...) Expand all Loading... | |
295 return true; | 295 return true; |
296 } | 296 } |
297 | 297 |
298 // This cannot be done as a static initializer sadly since Visual Studio will | 298 // This cannot be done as a static initializer sadly since Visual Studio will |
299 // eliminate this object file if there is no direct entry point into it. | 299 // eliminate this object file if there is no direct entry point into it. |
300 void RegisterPathProvider() { | 300 void RegisterPathProvider() { |
301 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); | 301 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
302 } | 302 } |
303 | 303 |
304 } // namespace chrome | 304 } // namespace chrome |
OLD | NEW |