Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: webkit/glue/plugins/plugin_list_linux.cc

Issue 199053: linux: split MOZ_PLUGIN_PATH on colons (Closed)
Patch Set: Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698