Chromium Code Reviews| 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 "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/mac/bundle_locations.h" | 10 #include "base/mac/bundle_locations.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 | 64 |
| 65 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 65 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 66 | 66 |
| 67 const FilePath::CharType kO3DPluginFileName[] = | 67 const FilePath::CharType kO3DPluginFileName[] = |
| 68 FILE_PATH_LITERAL("pepper/libppo3dautoplugin.so"); | 68 FILE_PATH_LITERAL("pepper/libppo3dautoplugin.so"); |
| 69 | 69 |
| 70 const FilePath::CharType kGTalkPluginFileName[] = | 70 const FilePath::CharType kGTalkPluginFileName[] = |
| 71 FILE_PATH_LITERAL("pepper/libppgoogletalk.so"); | 71 FILE_PATH_LITERAL("pepper/libppgoogletalk.so"); |
| 72 | 72 |
| 73 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) | 73 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) |
| 74 | |
| 75 #if defined(OS_LINUX) | |
| 76 // The search path that contains information about per-extension | |
| 77 // definition files. | |
|
Sam Kerner (Chrome)
2012/04/13 19:35:13
A comment with a link to a standard will help avoi
Alexandre Abreu
2012/04/13 21:52:38
Done.
| |
| 78 const char kFilepathSinglePrefExtensions[] = | |
| 79 #if defined(GOOGLE_CHROME_BUILD) | |
| 80 FILE_PATH_LITERAL("/usr/share/google-chrome/extensions"); | |
| 81 #else | |
| 82 FILE_PATH_LITERAL("/usr/share/chromium/extensions"); | |
| 83 #endif | |
| 84 #endif // defined(OS_LINUX) | |
| 85 | |
| 74 } // namespace | 86 } // namespace |
| 75 | 87 |
| 76 namespace chrome { | 88 namespace chrome { |
| 77 | 89 |
| 78 // Gets the path for internal plugins. | 90 // Gets the path for internal plugins. |
| 79 bool GetInternalPluginsDirectory(FilePath* result) { | 91 bool GetInternalPluginsDirectory(FilePath* result) { |
| 80 #if defined(OS_MACOSX) | 92 #if defined(OS_MACOSX) |
| 81 // If called from Chrome, get internal plugins from a subdirectory of the | 93 // If called from Chrome, get internal plugins from a subdirectory of the |
| 82 // framework. | 94 // framework. |
| 83 if (base::mac::AmIBundled()) { | 95 if (base::mac::AmIBundled()) { |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 357 } | 369 } |
| 358 #endif | 370 #endif |
| 359 #if defined(OS_CHROMEOS) || defined(OS_MACOSX) | 371 #if defined(OS_CHROMEOS) || defined(OS_MACOSX) |
| 360 case chrome::DIR_USER_EXTERNAL_EXTENSIONS: { | 372 case chrome::DIR_USER_EXTERNAL_EXTENSIONS: { |
| 361 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) | 373 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) |
| 362 return false; | 374 return false; |
| 363 cur = cur.Append(FILE_PATH_LITERAL("External Extensions")); | 375 cur = cur.Append(FILE_PATH_LITERAL("External Extensions")); |
| 364 break; | 376 break; |
| 365 } | 377 } |
| 366 #endif | 378 #endif |
| 379 case chrome::DIR_SINGLE_EXTERNAL_EXTENSIONS: { | |
| 380 #if defined(OS_LINUX) | |
| 381 cur = FilePath(FILE_PATH_LITERAL(kFilepathSinglePrefExtensions)); | |
| 382 #endif | |
| 383 break; | |
| 384 } | |
| 367 case chrome::DIR_EXTERNAL_EXTENSIONS: | 385 case chrome::DIR_EXTERNAL_EXTENSIONS: |
| 368 #if defined(OS_MACOSX) | 386 #if defined(OS_MACOSX) |
| 369 if (!chrome::GetGlobalApplicationSupportDirectory(&cur)) | 387 if (!chrome::GetGlobalApplicationSupportDirectory(&cur)) |
| 370 return false; | 388 return false; |
| 371 | 389 |
| 372 cur = cur.Append(FILE_PATH_LITERAL("Google")) | 390 cur = cur.Append(FILE_PATH_LITERAL("Google")) |
| 373 .Append(FILE_PATH_LITERAL("Chrome")) | 391 .Append(FILE_PATH_LITERAL("Chrome")) |
| 374 .Append(FILE_PATH_LITERAL("External Extensions")); | 392 .Append(FILE_PATH_LITERAL("External Extensions")); |
| 375 create_dir = false; | 393 create_dir = false; |
| 376 #else | 394 #else |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 405 return true; | 423 return true; |
| 406 } | 424 } |
| 407 | 425 |
| 408 // This cannot be done as a static initializer sadly since Visual Studio will | 426 // This cannot be done as a static initializer sadly since Visual Studio will |
| 409 // eliminate this object file if there is no direct entry point into it. | 427 // eliminate this object file if there is no direct entry point into it. |
| 410 void RegisterPathProvider() { | 428 void RegisterPathProvider() { |
| 411 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); | 429 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
| 412 } | 430 } |
| 413 | 431 |
| 414 } // namespace chrome | 432 } // namespace chrome |
| OLD | NEW |