| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/plugins/npapi/plugin_list.h" | 5 #include "webkit/plugins/npapi/plugin_list.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <dlfcn.h> | 8 #include <dlfcn.h> |
| 9 #if defined(OS_OPENBSD) | 9 #if defined(OS_OPENBSD) |
| 10 #include <sys/exec_elf.h> | 10 #include <sys/exec_elf.h> |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 info->version = UTF8ToUTF16(version); | 429 info->version = UTF8ToUTF16(version); |
| 430 } | 430 } |
| 431 } | 431 } |
| 432 | 432 |
| 433 void PluginList::GetPluginDirectories(std::vector<base::FilePath>* plugin_dirs)
{ | 433 void PluginList::GetPluginDirectories(std::vector<base::FilePath>* plugin_dirs)
{ |
| 434 // See http://groups.google.com/group/chromium-dev/browse_thread/thread/7a70e5
fcbac786a9 | 434 // See http://groups.google.com/group/chromium-dev/browse_thread/thread/7a70e5
fcbac786a9 |
| 435 // for discussion. | 435 // for discussion. |
| 436 // We first consult Chrome-specific dirs, then fall back on the logic | 436 // We first consult Chrome-specific dirs, then fall back on the logic |
| 437 // Mozilla uses. | 437 // Mozilla uses. |
| 438 | 438 |
| 439 // Note: "extra" plugin dirs, including the Plugins subdirectory of | 439 if (PluginList::plugins_discovery_disabled_) |
| 440 // your Chrome config, are examined before these. See the logic | 440 return; |
| 441 // related to extra_plugin_dirs in plugin_list.cc. | 441 |
| 442 // Note: "extra" plugin dirs and paths are examined before these. |
| 443 // "Extra" are those added by PluginList::AddExtraPluginDir() and |
| 444 // PluginList::AddExtraPluginPath(). |
| 442 | 445 |
| 443 // The Chrome binary dir + "plugins/". | 446 // The Chrome binary dir + "plugins/". |
| 444 base::FilePath dir; | 447 base::FilePath dir; |
| 445 PathService::Get(base::DIR_EXE, &dir); | 448 PathService::Get(base::DIR_EXE, &dir); |
| 446 plugin_dirs->push_back(dir.Append("plugins")); | 449 plugin_dirs->push_back(dir.Append("plugins")); |
| 447 | 450 |
| 448 // Chrome OS only loads plugins from /opt/google/chrome/plugins. | 451 // Chrome OS only loads plugins from /opt/google/chrome/plugins. |
| 449 #if !defined(OS_CHROMEOS) | 452 #if !defined(OS_CHROMEOS) |
| 450 // Mozilla code to reference: | 453 // Mozilla code to reference: |
| 451 // http://mxr.mozilla.org/firefox/ident?i=NS_APP_PLUGINS_DIR_LIST | 454 // http://mxr.mozilla.org/firefox/ident?i=NS_APP_PLUGINS_DIR_LIST |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 | 588 |
| 586 // TODO(evanm): prefer the newest version of flash, etc. here? | 589 // TODO(evanm): prefer the newest version of flash, etc. here? |
| 587 | 590 |
| 588 VLOG_IF(1, PluginList::DebugPluginLoading()) << "Using " << info.path.value(); | 591 VLOG_IF(1, PluginList::DebugPluginLoading()) << "Using " << info.path.value(); |
| 589 | 592 |
| 590 return true; | 593 return true; |
| 591 } | 594 } |
| 592 | 595 |
| 593 } // namespace npapi | 596 } // namespace npapi |
| 594 } // namespace webkit | 597 } // namespace webkit |
| OLD | NEW |