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

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) && !defined(OS_CHROMEOS)
76 // The search path that contains information about per-extension
77 // definition files.
Finnur 2012/04/25 13:33:45 Suggest: The path to the external extension <id>.j
Alexandre Abreu 2012/04/25 15:31:05 Done.
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 // defined(GOOGLE_CHROME_BUILD)
85 #endif // defined(OS_LINUX) && !defined(OS_CHROMEOS)
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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 } 367 }
355 #endif 368 #endif
356 #if defined(OS_CHROMEOS) || defined(OS_MACOSX) 369 #if defined(OS_CHROMEOS) || defined(OS_MACOSX)
357 case chrome::DIR_USER_EXTERNAL_EXTENSIONS: { 370 case chrome::DIR_USER_EXTERNAL_EXTENSIONS: {
358 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) 371 if (!PathService::Get(chrome::DIR_USER_DATA, &cur))
359 return false; 372 return false;
360 cur = cur.Append(FILE_PATH_LITERAL("External Extensions")); 373 cur = cur.Append(FILE_PATH_LITERAL("External Extensions"));
361 break; 374 break;
362 } 375 }
363 #endif 376 #endif
377 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
378 case chrome::DIR_STANDALONE_EXTERNAL_EXTENSIONS: {
379 cur = FilePath(FILE_PATH_LITERAL(kFilepathSinglePrefExtensions));
380 break;
381 }
382 #endif
364 case chrome::DIR_EXTERNAL_EXTENSIONS: 383 case chrome::DIR_EXTERNAL_EXTENSIONS:
365 #if defined(OS_MACOSX) 384 #if defined(OS_MACOSX)
366 if (!chrome::GetGlobalApplicationSupportDirectory(&cur)) 385 if (!chrome::GetGlobalApplicationSupportDirectory(&cur))
367 return false; 386 return false;
368 387
369 cur = cur.Append(FILE_PATH_LITERAL("Google")) 388 cur = cur.Append(FILE_PATH_LITERAL("Google"))
370 .Append(FILE_PATH_LITERAL("Chrome")) 389 .Append(FILE_PATH_LITERAL("Chrome"))
371 .Append(FILE_PATH_LITERAL("External Extensions")); 390 .Append(FILE_PATH_LITERAL("External Extensions"));
372 create_dir = false; 391 create_dir = false;
373 #else 392 #else
(...skipping 28 matching lines...) Expand all
402 return true; 421 return true;
403 } 422 }
404 423
405 // This cannot be done as a static initializer sadly since Visual Studio will 424 // 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. 425 // eliminate this object file if there is no direct entry point into it.
407 void RegisterPathProvider() { 426 void RegisterPathProvider() {
408 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); 427 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
409 } 428 }
410 429
411 } // namespace chrome 430 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698