| 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/browser/plugin_service.h" | 5 #include "chrome/browser/plugin_service.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 plugin_selection_policy_->StartInit(); | 119 plugin_selection_policy_->StartInit(); |
| 120 #endif | 120 #endif |
| 121 | 121 |
| 122 chrome::RegisterInternalGPUPlugin(); | 122 chrome::RegisterInternalGPUPlugin(); |
| 123 | 123 |
| 124 #if defined(OS_WIN) | 124 #if defined(OS_WIN) |
| 125 hkcu_key_.Create( | 125 hkcu_key_.Create( |
| 126 HKEY_CURRENT_USER, webkit::npapi::kRegistryMozillaPlugins, KEY_NOTIFY); | 126 HKEY_CURRENT_USER, webkit::npapi::kRegistryMozillaPlugins, KEY_NOTIFY); |
| 127 hklm_key_.Create( | 127 hklm_key_.Create( |
| 128 HKEY_LOCAL_MACHINE, webkit::npapi::kRegistryMozillaPlugins, KEY_NOTIFY); | 128 HKEY_LOCAL_MACHINE, webkit::npapi::kRegistryMozillaPlugins, KEY_NOTIFY); |
| 129 if (hkcu_key_.StartWatching()) { | 129 if (hkcu_key_.StartWatching() == ERROR_SUCCESS) { |
| 130 hkcu_event_.reset(new base::WaitableEvent(hkcu_key_.watch_event())); | 130 hkcu_event_.reset(new base::WaitableEvent(hkcu_key_.watch_event())); |
| 131 hkcu_watcher_.StartWatching(hkcu_event_.get(), this); | 131 hkcu_watcher_.StartWatching(hkcu_event_.get(), this); |
| 132 } | 132 } |
| 133 | 133 |
| 134 if (hklm_key_.StartWatching()) { | 134 if (hklm_key_.StartWatching() == ERROR_SUCCESS) { |
| 135 hklm_event_.reset(new base::WaitableEvent(hklm_key_.watch_event())); | 135 hklm_event_.reset(new base::WaitableEvent(hklm_key_.watch_event())); |
| 136 hklm_watcher_.StartWatching(hklm_event_.get(), this); | 136 hklm_watcher_.StartWatching(hklm_event_.get(), this); |
| 137 } | 137 } |
| 138 #elif defined(OS_POSIX) && !defined(OS_MACOSX) | 138 #elif defined(OS_POSIX) && !defined(OS_MACOSX) |
| 139 // Also find plugins in a user-specific plugins dir, | 139 // Also find plugins in a user-specific plugins dir, |
| 140 // e.g. ~/.config/chromium/Plugins. | 140 // e.g. ~/.config/chromium/Plugins. |
| 141 FilePath user_data_dir; | 141 FilePath user_data_dir; |
| 142 if (PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) { | 142 if (PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) { |
| 143 webkit::npapi::PluginList::Singleton()->AddExtraPluginDir( | 143 webkit::npapi::PluginList::Singleton()->AddExtraPluginDir( |
| 144 user_data_dir.Append("Plugins")); | 144 user_data_dir.Append("Plugins")); |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 info.mime_types = ASCIIToWide(JoinString(plugins[i].mime_types, '|')); | 420 info.mime_types = ASCIIToWide(JoinString(plugins[i].mime_types, '|')); |
| 421 | 421 |
| 422 // These NPAPI entry points will never be called. TODO(darin): Come up | 422 // These NPAPI entry points will never be called. TODO(darin): Come up |
| 423 // with a cleaner way to register pepper plugins with the NPAPI PluginList, | 423 // with a cleaner way to register pepper plugins with the NPAPI PluginList, |
| 424 // or perhaps refactor the PluginList to be less specific to NPAPI. | 424 // or perhaps refactor the PluginList to be less specific to NPAPI. |
| 425 memset(&info.entry_points, 0, sizeof(info.entry_points)); | 425 memset(&info.entry_points, 0, sizeof(info.entry_points)); |
| 426 | 426 |
| 427 webkit::npapi::PluginList::Singleton()->RegisterInternalPlugin(info); | 427 webkit::npapi::PluginList::Singleton()->RegisterInternalPlugin(info); |
| 428 } | 428 } |
| 429 } | 429 } |
| OLD | NEW |