···
1
+
diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc
2
+
index 8a205a6..d5c24e1 100644
3
+
--- a/chrome/common/chrome_paths.cc
4
+
+++ b/chrome/common/chrome_paths.cc
5
+
@@ -97,21 +97,14 @@ static base::LazyInstance<base::FilePath>
6
+
g_invalid_specified_user_data_dir = LAZY_INSTANCE_INITIALIZER;
8
+
// Gets the path for internal plugins.
9
+
-bool GetInternalPluginsDirectory(base::FilePath* result) {
10
+
-#if defined(OS_MACOSX) && !defined(OS_IOS)
11
+
- // If called from Chrome, get internal plugins from a subdirectory of the
13
+
- if (base::mac::AmIBundled()) {
14
+
- *result = chrome::GetFrameworkBundlePath();
15
+
- DCHECK(!result->empty());
16
+
- *result = result->Append("Internet Plug-Ins");
19
+
- // In tests, just look in the module directory (below).
22
+
- // The rest of the world expects plugins in the module directory.
23
+
- return PathService::Get(base::DIR_MODULE, result);
24
+
+bool GetInternalPluginsDirectory(base::FilePath* result,
25
+
+ const std::string& ident) {
26
+
+ std::string full_env = std::string("NIX_CHROMIUM_PLUGIN_PATH_") + ident;
27
+
+ const char* value = getenv(full_env.c_str());
28
+
+ if (value == NULL)
29
+
+ return PathService::Get(base::DIR_MODULE, result);
31
+
+ *result = base::FilePath(value);
35
+
@@ -248,11 +241,11 @@ bool PathProvider(int key, base::FilePath* result) {
38
+
case chrome::DIR_INTERNAL_PLUGINS:
39
+
- if (!GetInternalPluginsDirectory(&cur))
40
+
+ if (!GetInternalPluginsDirectory(&cur, "ALL"))
43
+
case chrome::DIR_PEPPER_FLASH_PLUGIN:
44
+
- if (!GetInternalPluginsDirectory(&cur))
45
+
+ if (!GetInternalPluginsDirectory(&cur, "PEPPERFLASH"))
47
+
cur = cur.Append(kPepperFlashBaseDirectory);
49
+
@@ -285,7 +278,7 @@ bool PathProvider(int key, base::FilePath* result) {
50
+
cur = cur.Append(FILE_PATH_LITERAL("script.log"));
52
+
case chrome::FILE_FLASH_PLUGIN:
53
+
- if (!GetInternalPluginsDirectory(&cur))
54
+
+ if (!GetInternalPluginsDirectory(&cur, "FILEFLASH"))
56
+
cur = cur.Append(kInternalFlashPluginFileName);
58
+
@@ -295,7 +288,7 @@ bool PathProvider(int key, base::FilePath* result) {
59
+
cur = cur.Append(chrome::kPepperFlashPluginFilename);
61
+
case chrome::FILE_EFFECTS_PLUGIN:
62
+
- if (!GetInternalPluginsDirectory(&cur))
63
+
+ if (!GetInternalPluginsDirectory(&cur, "FILE_EFFECTS"))
65
+
cur = cur.Append(kEffectsPluginFileName);
67
+
@@ -308,7 +301,7 @@ bool PathProvider(int key, base::FilePath* result) {
68
+
// We currently need a path here to look up whether the plugin is disabled
69
+
// and what its permissions are.
70
+
case chrome::FILE_NACL_PLUGIN:
71
+
- if (!GetInternalPluginsDirectory(&cur))
72
+
+ if (!GetInternalPluginsDirectory(&cur, "NACL"))
74
+
cur = cur.Append(kInternalNaClPluginFileName);
76
+
@@ -343,7 +336,7 @@ bool PathProvider(int key, base::FilePath* result) {
77
+
cur = cur.DirName();
80
+
- if (!GetInternalPluginsDirectory(&cur))
81
+
+ if (!GetInternalPluginsDirectory(&cur, "PNACL"))
84
+
cur = cur.Append(FILE_PATH_LITERAL("pnacl"));
85
+
@@ -372,7 +365,7 @@ bool PathProvider(int key, base::FilePath* result) {
86
+
// In the component case, this is the source adapter. Otherwise, it is the
87
+
// actual Pepper module that gets loaded.
88
+
case chrome::FILE_WIDEVINE_CDM_ADAPTER:
89
+
- if (!GetInternalPluginsDirectory(&cur))
90
+
+ if (!GetInternalPluginsDirectory(&cur, "WIDEVINE"))
92
+
cur = cur.AppendASCII(kWidevineCdmAdapterFileName);