| OLD | NEW |
| 1 // Copyright (c) 2010 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/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/sha1.h" | 9 #include "base/sha1.h" |
| 10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 #if !defined(OS_CHROMEOS) | 126 #if !defined(OS_CHROMEOS) |
| 127 // Mozilla code to reference: | 127 // Mozilla code to reference: |
| 128 // http://mxr.mozilla.org/firefox/ident?i=NS_APP_PLUGINS_DIR_LIST | 128 // http://mxr.mozilla.org/firefox/ident?i=NS_APP_PLUGINS_DIR_LIST |
| 129 // and tens of accompanying files (mxr is very helpful). | 129 // and tens of accompanying files (mxr is very helpful). |
| 130 // This code carefully matches their behavior for compat reasons. | 130 // This code carefully matches their behavior for compat reasons. |
| 131 | 131 |
| 132 // 1) MOZ_PLUGIN_PATH env variable. | 132 // 1) MOZ_PLUGIN_PATH env variable. |
| 133 const char* moz_plugin_path = getenv("MOZ_PLUGIN_PATH"); | 133 const char* moz_plugin_path = getenv("MOZ_PLUGIN_PATH"); |
| 134 if (moz_plugin_path) { | 134 if (moz_plugin_path) { |
| 135 std::vector<std::string> paths; | 135 std::vector<std::string> paths; |
| 136 SplitString(moz_plugin_path, ':', &paths); | 136 base::SplitString(moz_plugin_path, ':', &paths); |
| 137 for (size_t i = 0; i < paths.size(); ++i) | 137 for (size_t i = 0; i < paths.size(); ++i) |
| 138 plugin_dirs->push_back(FilePath(paths[i])); | 138 plugin_dirs->push_back(FilePath(paths[i])); |
| 139 } | 139 } |
| 140 | 140 |
| 141 // 2) NS_USER_PLUGINS_DIR: ~/.mozilla/plugins. | 141 // 2) NS_USER_PLUGINS_DIR: ~/.mozilla/plugins. |
| 142 // This is a de-facto standard, so even though we're not Mozilla, let's | 142 // This is a de-facto standard, so even though we're not Mozilla, let's |
| 143 // look in there too. | 143 // look in there too. |
| 144 FilePath home = file_util::GetHomeDir(); | 144 FilePath home = file_util::GetHomeDir(); |
| 145 if (!home.empty()) | 145 if (!home.empty()) |
| 146 plugin_dirs->push_back(home.Append(".mozilla/plugins")); | 146 plugin_dirs->push_back(home.Append(".mozilla/plugins")); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 | 262 |
| 263 // TODO(evanm): prefer the newest version of flash, etc. here? | 263 // TODO(evanm): prefer the newest version of flash, etc. here? |
| 264 | 264 |
| 265 LOG_IF(INFO, PluginList::DebugPluginLoading()) | 265 LOG_IF(INFO, PluginList::DebugPluginLoading()) |
| 266 << "Using " << info.path.value(); | 266 << "Using " << info.path.value(); |
| 267 | 267 |
| 268 return true; | 268 return true; |
| 269 } | 269 } |
| 270 | 270 |
| 271 } // namespace NPAPI | 271 } // namespace NPAPI |
| OLD | NEW |