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