OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/common/chrome_plugin_lib.h" | 5 #include "chrome/common/chrome_plugin_lib.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/hash_tables.h" | 8 #include "base/hash_tables.h" |
9 #include "base/histogram.h" | 9 #include "base/histogram.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 void ChromePluginLib::RegisterPluginsWithNPAPI() { | 115 void ChromePluginLib::RegisterPluginsWithNPAPI() { |
116 // We don't support ChromePlugins in single-process mode. | 116 // We don't support ChromePlugins in single-process mode. |
117 if (IsSingleProcessMode()) | 117 if (IsSingleProcessMode()) |
118 return; | 118 return; |
119 | 119 |
120 FilePath path; | 120 FilePath path; |
121 if (!PathService::Get(chrome::FILE_GEARS_PLUGIN, &path)) | 121 if (!PathService::Get(chrome::FILE_GEARS_PLUGIN, &path)) |
122 return; | 122 return; |
123 // Note: we can only access the NPAPI list because the PluginService has done | 123 // Note: we can only access the NPAPI list because the PluginService has done |
124 // the locking for us. We should not touch it anywhere else. | 124 // the locking for us. We should not touch it anywhere else. |
125 #if defined(OS_WIN) || defined(OS_LINUX) | |
126 NPAPI::PluginList::AddExtraPluginPath(path); | 125 NPAPI::PluginList::AddExtraPluginPath(path); |
127 #else | |
128 // TODO(port): plugins not yet implemented | |
129 NOTIMPLEMENTED(); | |
130 #endif | |
131 } | 126 } |
132 | 127 |
133 static void LogPluginLoadTime(const TimeDelta &time) { | 128 static void LogPluginLoadTime(const TimeDelta &time) { |
134 UMA_HISTOGRAM_TIMES("Gears.LoadTime", time); | 129 UMA_HISTOGRAM_TIMES("Gears.LoadTime", time); |
135 } | 130 } |
136 | 131 |
137 // static | 132 // static |
138 void ChromePluginLib::LoadChromePlugins(const CPBrowserFuncs* bfuncs) { | 133 void ChromePluginLib::LoadChromePlugins(const CPBrowserFuncs* bfuncs) { |
139 static bool loaded = false; | 134 static bool loaded = false; |
140 if (loaded) | 135 if (loaded) |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 if (initialized_) | 297 if (initialized_) |
303 CP_Shutdown(); | 298 CP_Shutdown(); |
304 | 299 |
305 #if defined(OS_WIN) | 300 #if defined(OS_WIN) |
306 if (module_) { | 301 if (module_) { |
307 FreeLibrary(module_); | 302 FreeLibrary(module_); |
308 module_ = 0; | 303 module_ = 0; |
309 } | 304 } |
310 #endif | 305 #endif |
311 } | 306 } |
OLD | NEW |