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