Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(295)

Side by Side Diff: chrome/common/chrome_paths.cc

Issue 9963120: Introduces an additional extension loader that load extra extensions based on per-extension json fi… (Closed) Base URL: https://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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.
78 // /usr/share seems like a good choice, see: http://www.pathname.com/fhs/
79 const char kFilepathSinglePrefExtensions[] =
80 #if defined(GOOGLE_CHROME_BUILD)
81 FILE_PATH_LITERAL("/usr/share/google-chrome/extensions");
82 #else
83 FILE_PATH_LITERAL("/usr/share/chromium/extensions");
84 #endif
85 #endif // defined(OS_LINUX)
86
74 } // namespace 87 } // namespace
75 88
76 namespace chrome { 89 namespace chrome {
77 90
78 // Gets the path for internal plugins. 91 // Gets the path for internal plugins.
79 bool GetInternalPluginsDirectory(FilePath* result) { 92 bool GetInternalPluginsDirectory(FilePath* result) {
80 #if defined(OS_MACOSX) 93 #if defined(OS_MACOSX)
81 // If called from Chrome, get internal plugins from a subdirectory of the 94 // If called from Chrome, get internal plugins from a subdirectory of the
82 // framework. 95 // framework.
83 if (base::mac::AmIBundled()) { 96 if (base::mac::AmIBundled()) {
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 } 370 }
358 #endif 371 #endif
359 #if defined(OS_CHROMEOS) || defined(OS_MACOSX) 372 #if defined(OS_CHROMEOS) || defined(OS_MACOSX)
360 case chrome::DIR_USER_EXTERNAL_EXTENSIONS: { 373 case chrome::DIR_USER_EXTERNAL_EXTENSIONS: {
361 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) 374 if (!PathService::Get(chrome::DIR_USER_DATA, &cur))
362 return false; 375 return false;
363 cur = cur.Append(FILE_PATH_LITERAL("External Extensions")); 376 cur = cur.Append(FILE_PATH_LITERAL("External Extensions"));
364 break; 377 break;
365 } 378 }
366 #endif 379 #endif
380 #if defined(OS_LINUX)
381 case chrome::DIR_SINGLE_EXTERNAL_EXTENSIONS: {
382 cur = FilePath(FILE_PATH_LITERAL(kFilepathSinglePrefExtensions));
383 break;
384 }
385 #endif
367 case chrome::DIR_EXTERNAL_EXTENSIONS: 386 case chrome::DIR_EXTERNAL_EXTENSIONS:
368 #if defined(OS_MACOSX) 387 #if defined(OS_MACOSX)
369 if (!chrome::GetGlobalApplicationSupportDirectory(&cur)) 388 if (!chrome::GetGlobalApplicationSupportDirectory(&cur))
370 return false; 389 return false;
371 390
372 cur = cur.Append(FILE_PATH_LITERAL("Google")) 391 cur = cur.Append(FILE_PATH_LITERAL("Google"))
373 .Append(FILE_PATH_LITERAL("Chrome")) 392 .Append(FILE_PATH_LITERAL("Chrome"))
374 .Append(FILE_PATH_LITERAL("External Extensions")); 393 .Append(FILE_PATH_LITERAL("External Extensions"));
375 create_dir = false; 394 create_dir = false;
376 #else 395 #else
(...skipping 28 matching lines...) Expand all
405 return true; 424 return true;
406 } 425 }
407 426
408 // This cannot be done as a static initializer sadly since Visual Studio will 427 // 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. 428 // eliminate this object file if there is no direct entry point into it.
410 void RegisterPathProvider() { 429 void RegisterPathProvider() {
411 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); 430 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
412 } 431 }
413 432
414 } // namespace chrome 433 } // namespace chrome
OLDNEW
« chrome/browser/extensions/external_extension_util.cc ('K') | « chrome/common/chrome_paths.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698