@@ -0,0 +1,70 @@
1+diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc
2+index f4e119d..d9775bd 100644
3+--- a/chrome/common/chrome_paths.cc
4++++ b/chrome/common/chrome_paths.cc
5+@@ -68,21 +68,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+ // Gets the path for bundled implementations of components. Note that these
35+@@ -272,7 +265,7 @@ 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_COMPONENTS:
44+@@ -280,7 +273,7 @@ bool PathProvider(int key, base::FilePath* result) {
45+ return false;
46+ break;
47+ case chrome::DIR_PEPPER_FLASH_PLUGIN:
48+- if (!GetInternalPluginsDirectory(&cur))
49++ if (!GetInternalPluginsDirectory(&cur, "PEPPERFLASH"))
50+ return false;
51+ cur = cur.Append(kPepperFlashBaseDirectory);
52+ break;
53+@@ -323,7 +316,7 @@ bool PathProvider(int key, base::FilePath* result) {
54+ // We currently need a path here to look up whether the plugin is disabled
55+ // and what its permissions are.
56+ case chrome::FILE_NACL_PLUGIN:
57+- if (!GetInternalPluginsDirectory(&cur))
58++ if (!GetInternalPluginsDirectory(&cur, "NACL"))
59+ return false;
60+ cur = cur.Append(kInternalNaClPluginFileName);
61+ break;
62+@@ -358,7 +351,7 @@ bool PathProvider(int key, base::FilePath* result) {
63+ cur = cur.DirName();
64+ }
65+ #else
66+- if (!GetInternalPluginsDirectory(&cur))
67++ if (!GetInternalPluginsDirectory(&cur, "PNACL"))
68+ return false;
69+ #endif
70+ cur = cur.Append(FILE_PATH_LITERAL("pnacl"));