| 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 "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/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/perftimer.h" | 12 #include "base/perftimer.h" |
| 13 #include "base/thread.h" | 13 #include "base/thread.h" |
| 14 #if defined(OS_WIN) | 14 #if defined(OS_WIN) |
| 15 #include "base/win/registry.h" | 15 #include "base/win/registry.h" |
| 16 #endif | 16 #endif |
| 17 #include "base/string_util.h" | 17 #include "base/string_util.h" |
| 18 #include "chrome/common/chrome_counters.h" | 18 #include "chrome/common/chrome_counters.h" |
| 19 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
| 20 #include "chrome/common/notification_service.h" | 20 #include "chrome/common/notification_service.h" |
| 21 #include "chrome/common/chrome_paths.h" | 21 #include "chrome/common/chrome_paths.h" |
| 22 #include "webkit/plugins/npapi/plugin_list.h" | 22 #include "webkit/glue/plugins/plugin_list.h" |
| 23 | 23 |
| 24 using base::TimeDelta; | 24 using base::TimeDelta; |
| 25 | 25 |
| 26 // TODO(port): revisit when plugins happier | 26 // TODO(port): revisit when plugins happier |
| 27 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
| 28 const wchar_t ChromePluginLib::kRegistryChromePlugins[] = | 28 const wchar_t ChromePluginLib::kRegistryChromePlugins[] = |
| 29 L"Software\\Google\\Chrome\\Plugins"; | 29 L"Software\\Google\\Chrome\\Plugins"; |
| 30 static const wchar_t kRegistryLoadOnStartup[] = L"LoadOnStartup"; | 30 static const wchar_t kRegistryLoadOnStartup[] = L"LoadOnStartup"; |
| 31 static const wchar_t kRegistryPath[] = L"Path"; | 31 static const wchar_t kRegistryPath[] = L"Path"; |
| 32 #endif | 32 #endif |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 // static | 108 // static |
| 109 void ChromePluginLib::RegisterPluginsWithNPAPI() { | 109 void ChromePluginLib::RegisterPluginsWithNPAPI() { |
| 110 // We don't support ChromePlugins in single-process mode. | 110 // We don't support ChromePlugins in single-process mode. |
| 111 if (IsSingleProcessMode()) | 111 if (IsSingleProcessMode()) |
| 112 return; | 112 return; |
| 113 | 113 |
| 114 FilePath path; | 114 FilePath path; |
| 115 // Register Gears, if available. | 115 // Register Gears, if available. |
| 116 if (PathService::Get(chrome::FILE_GEARS_PLUGIN, &path)) | 116 if (PathService::Get(chrome::FILE_GEARS_PLUGIN, &path)) |
| 117 webkit::npapi::PluginList::Singleton()->AddExtraPluginPath(path); | 117 NPAPI::PluginList::Singleton()->AddExtraPluginPath(path); |
| 118 } | 118 } |
| 119 | 119 |
| 120 static void LogPluginLoadTime(const TimeDelta &time) { | 120 static void LogPluginLoadTime(const TimeDelta &time) { |
| 121 UMA_HISTOGRAM_TIMES("Gears.LoadTime", time); | 121 UMA_HISTOGRAM_TIMES("Gears.LoadTime", time); |
| 122 } | 122 } |
| 123 | 123 |
| 124 // static | 124 // static |
| 125 void ChromePluginLib::LoadChromePlugins(const CPBrowserFuncs* bfuncs) { | 125 void ChromePluginLib::LoadChromePlugins(const CPBrowserFuncs* bfuncs) { |
| 126 static bool loaded = false; | 126 static bool loaded = false; |
| 127 if (loaded) | 127 if (loaded) |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 if (initialized_) | 281 if (initialized_) |
| 282 CP_Shutdown(); | 282 CP_Shutdown(); |
| 283 | 283 |
| 284 #if defined(OS_WIN) | 284 #if defined(OS_WIN) |
| 285 if (module_) { | 285 if (module_) { |
| 286 FreeLibrary(module_); | 286 FreeLibrary(module_); |
| 287 module_ = 0; | 287 module_ = 0; |
| 288 } | 288 } |
| 289 #endif | 289 #endif |
| 290 } | 290 } |
| OLD | NEW |