@@ -0,0 +1,75 @@
1+diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc
2+index 74bf041..5f34198 100644
3+--- a/chrome/common/chrome_paths.cc
4++++ b/chrome/common/chrome_paths.cc
5+@@ -66,21 +66,14 @@ static base::LazyInstance<base::FilePath>
6+ g_invalid_specified_user_data_dir = LAZY_INSTANCE_INITIALIZER;
7+
8+ // Gets the path for internal plugins.
9+-bool GetInternalPluginsDirectory(base::FilePath* result) {
10+-#if defined(OS_MACOSX)
11+- // If called from Chrome, get internal plugins from a subdirectory of the
12+- // framework.
13+- if (base::mac::AmIBundled()) {
14+- *result = chrome::GetFrameworkBundlePath();
15+- DCHECK(!result->empty());
16+- *result = result->Append("Internet Plug-Ins");
17+- return true;
18+- }
19+- // In tests, just look in the module directory (below).
20+-#endif
21+-
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);
30++ else
31++ *result = base::FilePath(value);
32+ }
33+
34+ #if defined(OS_WIN)
35+@@ -253,11 +246,11 @@ bool PathProvider(int key, base::FilePath* result) {
36+ create_dir = true;
37+ break;
38+ case chrome::DIR_INTERNAL_PLUGINS:
39+- if (!GetInternalPluginsDirectory(&cur))
40++ if (!GetInternalPluginsDirectory(&cur, "ALL"))
41+ return false;
42+ break;
43+ case chrome::DIR_PEPPER_FLASH_PLUGIN:
44+- if (!GetInternalPluginsDirectory(&cur))
45++ if (!GetInternalPluginsDirectory(&cur, "PEPPERFLASH"))
46+ return false;
47+ cur = cur.Append(kPepperFlashBaseDirectory);
48+ break;
49+@@ -314,7 +307,7 @@ bool PathProvider(int key, base::FilePath* result) {
50+ // We currently need a path here to look up whether the plugin is disabled
51+ // and what its permissions are.
52+ case chrome::FILE_NACL_PLUGIN:
53+- if (!GetInternalPluginsDirectory(&cur))
54++ if (!GetInternalPluginsDirectory(&cur, "NACL"))
55+ return false;
56+ cur = cur.Append(kInternalNaClPluginFileName);
57+ break;
58+@@ -349,7 +342,7 @@ bool PathProvider(int key, base::FilePath* result) {
59+ cur = cur.DirName();
60+ }
61+ #else
62+- if (!GetInternalPluginsDirectory(&cur))
63++ if (!GetInternalPluginsDirectory(&cur, "PNACL"))
64+ return false;
65+ #endif
66+ cur = cur.Append(FILE_PATH_LITERAL("pnacl"));
67+@@ -366,7 +359,7 @@ bool PathProvider(int key, base::FilePath* result) {
68+ // In the component case, this is the source adapter. Otherwise, it is the
69+ // actual Pepper module that gets loaded.
70+ case chrome::FILE_WIDEVINE_CDM_ADAPTER:
71+- if (!GetInternalPluginsDirectory(&cur))
72++ if (!GetInternalPluginsDirectory(&cur, "WIDEVINE"))
73+ return false;
74+ cur = cur.AppendASCII(kWidevineCdmAdapterFileName);
75+ break;