| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/glue/plugins/plugin_list.h" | 5 #include "webkit/glue/plugins/plugin_list.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 if (moz_plugin_path) { | 87 if (moz_plugin_path) { |
| 88 std::vector<std::string> paths; | 88 std::vector<std::string> paths; |
| 89 SplitString(moz_plugin_path, ':', &paths); | 89 SplitString(moz_plugin_path, ':', &paths); |
| 90 for (size_t i = 0; i < paths.size(); ++i) | 90 for (size_t i = 0; i < paths.size(); ++i) |
| 91 plugin_dirs->push_back(FilePath(paths[i])); | 91 plugin_dirs->push_back(FilePath(paths[i])); |
| 92 } | 92 } |
| 93 | 93 |
| 94 // 2) NS_USER_PLUGINS_DIR: ~/.mozilla/plugins. | 94 // 2) NS_USER_PLUGINS_DIR: ~/.mozilla/plugins. |
| 95 // This is a de-facto standard, so even though we're not Mozilla, let's | 95 // This is a de-facto standard, so even though we're not Mozilla, let's |
| 96 // look in there too. | 96 // look in there too. |
| 97 const char* home = getenv("HOME"); | 97 FilePath home = file_util::GetHomeDir(); |
| 98 if (home) | 98 if (!home.empty()) |
| 99 plugin_dirs->push_back(FilePath(home).Append(".mozilla/plugins")); | 99 plugin_dirs->push_back(home.Append(".mozilla/plugins")); |
| 100 | 100 |
| 101 // 3) NS_SYSTEM_PLUGINS_DIR: | 101 // 3) NS_SYSTEM_PLUGINS_DIR: |
| 102 // This varies across different browsers and versions, so check 'em all. | 102 // This varies across different browsers and versions, so check 'em all. |
| 103 plugin_dirs->push_back(FilePath("/usr/lib/browser-plugins")); | 103 plugin_dirs->push_back(FilePath("/usr/lib/browser-plugins")); |
| 104 plugin_dirs->push_back(FilePath("/usr/lib/mozilla/plugins")); | 104 plugin_dirs->push_back(FilePath("/usr/lib/mozilla/plugins")); |
| 105 plugin_dirs->push_back(FilePath("/usr/lib/firefox/plugins")); | 105 plugin_dirs->push_back(FilePath("/usr/lib/firefox/plugins")); |
| 106 plugin_dirs->push_back(FilePath("/usr/lib/xulrunner-addons/plugins")); | 106 plugin_dirs->push_back(FilePath("/usr/lib/xulrunner-addons/plugins")); |
| 107 | 107 |
| 108 #if defined(ARCH_CPU_64_BITS) | 108 #if defined(ARCH_CPU_64_BITS) |
| 109 // On my Ubuntu system, /usr/lib64 is a symlink to /usr/lib. | 109 // On my Ubuntu system, /usr/lib64 is a symlink to /usr/lib. |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 } | 206 } |
| 207 } | 207 } |
| 208 | 208 |
| 209 // TODO(evanm): prefer the newest version of flash, etc. here? | 209 // TODO(evanm): prefer the newest version of flash, etc. here? |
| 210 | 210 |
| 211 PLUG_LOG << "Using " << info.path.value(); | 211 PLUG_LOG << "Using " << info.path.value(); |
| 212 | 212 |
| 213 return true; | 213 return true; |
| 214 } | 214 } |
| 215 | 215 |
| 216 } // namespace NPAPI | 216 } // namespace NPAPI |
| OLD | NEW |