OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 } | 50 } |
51 | 51 |
52 void PluginList::GetPluginDirectories(std::vector<FilePath>* plugin_dirs) { | 52 void PluginList::GetPluginDirectories(std::vector<FilePath>* plugin_dirs) { |
53 // Mozilla code to reference: | 53 // Mozilla code to reference: |
54 // http://mxr.mozilla.org/firefox/ident?i=NS_APP_PLUGINS_DIR_LIST | 54 // http://mxr.mozilla.org/firefox/ident?i=NS_APP_PLUGINS_DIR_LIST |
55 // and tens of accompanying files (mxr is very helpful). | 55 // and tens of accompanying files (mxr is very helpful). |
56 // This code carefully matches their behavior for compat reasons. | 56 // This code carefully matches their behavior for compat reasons. |
57 | 57 |
58 // 1) MOZ_PLUGIN_PATH env variable. | 58 // 1) MOZ_PLUGIN_PATH env variable. |
59 const char* moz_plugin_path = getenv("MOZ_PLUGIN_PATH"); | 59 const char* moz_plugin_path = getenv("MOZ_PLUGIN_PATH"); |
60 if (moz_plugin_path) | 60 if (moz_plugin_path) { |
61 plugin_dirs->push_back(FilePath(moz_plugin_path)); | 61 std::vector<std::string> paths; |
| 62 SplitString(moz_plugin_path, ':', &paths); |
| 63 for (size_t i = 0; i < paths.size(); ++i) |
| 64 plugin_dirs->push_back(FilePath(paths[i])); |
| 65 } |
62 | 66 |
63 // 2) NS_USER_PLUGINS_DIR: ~/.mozilla/plugins. | 67 // 2) NS_USER_PLUGINS_DIR: ~/.mozilla/plugins. |
64 // This is a de-facto standard, so even though we're not Mozilla, let's | 68 // This is a de-facto standard, so even though we're not Mozilla, let's |
65 // look in there too. | 69 // look in there too. |
66 const char* home = getenv("HOME"); | 70 const char* home = getenv("HOME"); |
67 if (home) | 71 if (home) |
68 plugin_dirs->push_back(FilePath(home).Append(".mozilla/plugins")); | 72 plugin_dirs->push_back(FilePath(home).Append(".mozilla/plugins")); |
69 // TODO(evanm): maybe consult our own plugins dir, like | 73 // TODO(evanm): maybe consult our own plugins dir, like |
70 // ~/.config/chromium/Plugins? | 74 // ~/.config/chromium/Plugins? |
71 | 75 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 | 170 |
167 // TODO(evanm): prefer the newest version of flash, etc. here? | 171 // TODO(evanm): prefer the newest version of flash, etc. here? |
168 | 172 |
169 if (DebugPluginLoading()) | 173 if (DebugPluginLoading()) |
170 LOG(INFO) << "Using " << info.path.value(); | 174 LOG(INFO) << "Using " << info.path.value(); |
171 | 175 |
172 return true; | 176 return true; |
173 } | 177 } |
174 | 178 |
175 } // namespace NPAPI | 179 } // namespace NPAPI |
OLD | NEW |