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" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 // phase out registry keys from the gears installer. | 146 // phase out registry keys from the gears installer. |
147 #if 0 | 147 #if 0 |
148 for (RegistryKeyIterator iter(HKEY_CURRENT_USER, kRegistryChromePlugins); | 148 for (RegistryKeyIterator iter(HKEY_CURRENT_USER, kRegistryChromePlugins); |
149 iter.Valid(); ++iter) { | 149 iter.Valid(); ++iter) { |
150 // Use the registry to gather plugin across the file system. | 150 // Use the registry to gather plugin across the file system. |
151 std::wstring reg_path = kRegistryChromePlugins; | 151 std::wstring reg_path = kRegistryChromePlugins; |
152 reg_path.append(L"\\"); | 152 reg_path.append(L"\\"); |
153 reg_path.append(iter.Name()); | 153 reg_path.append(iter.Name()); |
154 base::win::RegKey key(HKEY_CURRENT_USER, reg_path.c_str()); | 154 base::win::RegKey key(HKEY_CURRENT_USER, reg_path.c_str()); |
155 | 155 |
156 DWORD is_persistent; | 156 DWORD is_persistent = 0; |
157 if (key.ReadValueDW(kRegistryLoadOnStartup, &is_persistent) && | 157 key.ReadValueDW(kRegistryLoadOnStartup, &is_persistent); |
158 is_persistent) { | 158 if (is_persistent) { |
159 std::wstring path; | 159 std::wstring path; |
160 if (key.ReadValue(kRegistryPath, &path)) { | 160 if (key.ReadValue(kRegistryPath, &path) == ERROR_SUCCESS) { |
161 ChromePluginLib::Create(path, bfuncs); | 161 ChromePluginLib::Create(path, bfuncs); |
162 } | 162 } |
163 } | 163 } |
164 } | 164 } |
165 #endif | 165 #endif |
166 } | 166 } |
167 | 167 |
168 // static | 168 // static |
169 void ChromePluginLib::UnloadAllPlugins() { | 169 void ChromePluginLib::UnloadAllPlugins() { |
170 if (g_loaded_libs) { | 170 if (g_loaded_libs) { |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 if (initialized_) | 283 if (initialized_) |
284 CP_Shutdown(); | 284 CP_Shutdown(); |
285 | 285 |
286 #if defined(OS_WIN) | 286 #if defined(OS_WIN) |
287 if (module_) { | 287 if (module_) { |
288 FreeLibrary(module_); | 288 FreeLibrary(module_); |
289 module_ = 0; | 289 module_ = 0; |
290 } | 290 } |
291 #endif | 291 #endif |
292 } | 292 } |
OLD | NEW |