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) && !defined(OS_CHROMEOS) |
| 76 // The path to the external extension <id>.json files. |
| 77 // /usr/share seems like a good choice, see: http://www.pathname.com/fhs/ |
| 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 // defined(GOOGLE_CHROME_BUILD) |
| 84 #endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 } | 366 } |
355 #endif | 367 #endif |
356 #if defined(OS_CHROMEOS) || defined(OS_MACOSX) | 368 #if defined(OS_CHROMEOS) || defined(OS_MACOSX) |
357 case chrome::DIR_USER_EXTERNAL_EXTENSIONS: { | 369 case chrome::DIR_USER_EXTERNAL_EXTENSIONS: { |
358 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) | 370 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) |
359 return false; | 371 return false; |
360 cur = cur.Append(FILE_PATH_LITERAL("External Extensions")); | 372 cur = cur.Append(FILE_PATH_LITERAL("External Extensions")); |
361 break; | 373 break; |
362 } | 374 } |
363 #endif | 375 #endif |
| 376 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 377 case chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS: { |
| 378 cur = FilePath(FILE_PATH_LITERAL(kFilepathSinglePrefExtensions)); |
| 379 break; |
| 380 } |
| 381 #endif |
364 case chrome::DIR_EXTERNAL_EXTENSIONS: | 382 case chrome::DIR_EXTERNAL_EXTENSIONS: |
365 #if defined(OS_MACOSX) | 383 #if defined(OS_MACOSX) |
366 if (!chrome::GetGlobalApplicationSupportDirectory(&cur)) | 384 if (!chrome::GetGlobalApplicationSupportDirectory(&cur)) |
367 return false; | 385 return false; |
368 | 386 |
369 cur = cur.Append(FILE_PATH_LITERAL("Google")) | 387 cur = cur.Append(FILE_PATH_LITERAL("Google")) |
370 .Append(FILE_PATH_LITERAL("Chrome")) | 388 .Append(FILE_PATH_LITERAL("Chrome")) |
371 .Append(FILE_PATH_LITERAL("External Extensions")); | 389 .Append(FILE_PATH_LITERAL("External Extensions")); |
372 create_dir = false; | 390 create_dir = false; |
373 #else | 391 #else |
(...skipping 28 matching lines...) Expand all Loading... |
402 return true; | 420 return true; |
403 } | 421 } |
404 | 422 |
405 // This cannot be done as a static initializer sadly since Visual Studio will | 423 // This cannot be done as a static initializer sadly since Visual Studio will |
406 // eliminate this object file if there is no direct entry point into it. | 424 // eliminate this object file if there is no direct entry point into it. |
407 void RegisterPathProvider() { | 425 void RegisterPathProvider() { |
408 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); | 426 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
409 } | 427 } |
410 | 428 |
411 } // namespace chrome | 429 } // namespace chrome |
OLD | NEW |