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/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/mac/bundle_locations.h" | 9 #include "base/mac/bundle_locations.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 68 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
69 | 69 |
70 const FilePath::CharType kO3DPluginFileName[] = | 70 const FilePath::CharType kO3DPluginFileName[] = |
71 FILE_PATH_LITERAL("pepper/libppo3dautoplugin.so"); | 71 FILE_PATH_LITERAL("pepper/libppo3dautoplugin.so"); |
72 | 72 |
73 const FilePath::CharType kGTalkPluginFileName[] = | 73 const FilePath::CharType kGTalkPluginFileName[] = |
74 FILE_PATH_LITERAL("pepper/libppgoogletalk.so"); | 74 FILE_PATH_LITERAL("pepper/libppgoogletalk.so"); |
75 | 75 |
76 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) | 76 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) |
77 | 77 |
78 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 78 #if defined(OS_LINUX) |
79 // The path to the external extension <id>.json files. | 79 // The path to the external extension <id>.json files. |
80 // /usr/share seems like a good choice, see: http://www.pathname.com/fhs/ | 80 // /usr/share seems like a good choice, see: http://www.pathname.com/fhs/ |
81 const char kFilepathSinglePrefExtensions[] = | 81 const char kFilepathSinglePrefExtensions[] = |
82 #if defined(GOOGLE_CHROME_BUILD) | 82 #if defined(GOOGLE_CHROME_BUILD) |
83 FILE_PATH_LITERAL("/usr/share/google-chrome/extensions"); | 83 FILE_PATH_LITERAL("/usr/share/google-chrome/extensions"); |
84 #else | 84 #else |
85 FILE_PATH_LITERAL("/usr/share/chromium/extensions"); | 85 FILE_PATH_LITERAL("/usr/share/chromium/extensions"); |
86 #endif // defined(GOOGLE_CHROME_BUILD) | 86 #endif // defined(GOOGLE_CHROME_BUILD) |
87 #endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) | 87 #endif // defined(OS_LINUX) |
88 | 88 |
89 } // namespace | 89 } // namespace |
90 | 90 |
91 namespace chrome { | 91 namespace chrome { |
92 | 92 |
93 // Gets the path for internal plugins. | 93 // Gets the path for internal plugins. |
94 bool GetInternalPluginsDirectory(FilePath* result) { | 94 bool GetInternalPluginsDirectory(FilePath* result) { |
95 #if defined(OS_MACOSX) | 95 #if defined(OS_MACOSX) |
96 // If called from Chrome, get internal plugins from a subdirectory of the | 96 // If called from Chrome, get internal plugins from a subdirectory of the |
97 // framework. | 97 // framework. |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 } | 409 } |
410 #endif | 410 #endif |
411 #if defined(OS_CHROMEOS) || defined(OS_MACOSX) | 411 #if defined(OS_CHROMEOS) || defined(OS_MACOSX) |
412 case chrome::DIR_USER_EXTERNAL_EXTENSIONS: { | 412 case chrome::DIR_USER_EXTERNAL_EXTENSIONS: { |
413 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) | 413 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) |
414 return false; | 414 return false; |
415 cur = cur.Append(FILE_PATH_LITERAL("External Extensions")); | 415 cur = cur.Append(FILE_PATH_LITERAL("External Extensions")); |
416 break; | 416 break; |
417 } | 417 } |
418 #endif | 418 #endif |
419 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 419 #if defined(OS_LINUX) |
420 case chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS: { | 420 case chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS: { |
421 cur = FilePath(FILE_PATH_LITERAL(kFilepathSinglePrefExtensions)); | 421 cur = FilePath(FILE_PATH_LITERAL(kFilepathSinglePrefExtensions)); |
422 break; | 422 break; |
423 } | 423 } |
424 #endif | 424 #endif |
425 case chrome::DIR_EXTERNAL_EXTENSIONS: | 425 case chrome::DIR_EXTERNAL_EXTENSIONS: |
426 #if defined(OS_MACOSX) | 426 #if defined(OS_MACOSX) |
427 if (!chrome::GetGlobalApplicationSupportDirectory(&cur)) | 427 if (!chrome::GetGlobalApplicationSupportDirectory(&cur)) |
428 return false; | 428 return false; |
429 | 429 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 return true; | 463 return true; |
464 } | 464 } |
465 | 465 |
466 // This cannot be done as a static initializer sadly since Visual Studio will | 466 // This cannot be done as a static initializer sadly since Visual Studio will |
467 // eliminate this object file if there is no direct entry point into it. | 467 // eliminate this object file if there is no direct entry point into it. |
468 void RegisterPathProvider() { | 468 void RegisterPathProvider() { |
469 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); | 469 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
470 } | 470 } |
471 | 471 |
472 } // namespace chrome | 472 } // namespace chrome |
OLD | NEW |