Index: chrome/common/chrome_paths.cc |
diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc |
index c7462488e883bde329b393b3701d8040e384813b..2620762a1965cdd76cba651032fbc4283c547880 100644 |
--- a/chrome/common/chrome_paths.cc |
+++ b/chrome/common/chrome_paths.cc |
@@ -85,6 +85,23 @@ bool GetInternalPluginsDirectory(base::FilePath* result) { |
return PathService::Get(base::DIR_MODULE, result); |
} |
+// Gets the path for internal plugins. |
Nico
2016/05/16 21:09:52
this comment could point that out then
waffles
2016/05/16 21:32:34
Done.
|
+bool GetComponentDirectory(base::FilePath* result) { |
+#if defined(OS_MACOSX) |
+ // If called from Chrome, return the framework's Libraries directory. |
+ if (base::mac::AmIBundled()) { |
+ *result = chrome::GetFrameworkBundlePath(); |
+ DCHECK(!result->empty()); |
+ *result = result->Append("Libraries"); |
+ return true; |
+ } |
+// In tests, just look in the module directory (below). |
+#endif |
+ |
+ // The rest of the world expects components in the module directory. |
+ return PathService::Get(base::DIR_MODULE, result); |
+} |
+ |
#if defined(OS_WIN) |
// Gets the Pepper Flash path if installed on the system. |
bool GetSystemFlashFilename(base::FilePath* out_path) { |
@@ -256,6 +273,10 @@ bool PathProvider(int key, base::FilePath* result) { |
if (!GetInternalPluginsDirectory(&cur)) |
return false; |
break; |
+ case chrome::DIR_COMPONENTS: |
+ if (!GetComponentDirectory(&cur)) |
+ return false; |
+ break; |
case chrome::DIR_PEPPER_FLASH_PLUGIN: |
if (!GetInternalPluginsDirectory(&cur)) |
return false; |