Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Side by Side Diff: content/browser/plugin_service_impl.cc

Issue 12087120: Revert 179987 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/plugin_service_impl.h ('k') | ipc/ipc_sync_channel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/plugin_service_impl.h" 5 #include "content/browser/plugin_service_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 void PluginServiceImpl::StartWatchingPlugins() { 179 void PluginServiceImpl::StartWatchingPlugins() {
180 // Start watching for changes in the plugin list. This means watching 180 // Start watching for changes in the plugin list. This means watching
181 // for changes in the Windows registry keys and on both Windows and POSIX 181 // for changes in the Windows registry keys and on both Windows and POSIX
182 // watch for changes in the paths that are expected to contain plugins. 182 // watch for changes in the paths that are expected to contain plugins.
183 #if defined(OS_WIN) 183 #if defined(OS_WIN)
184 if (hkcu_key_.Create(HKEY_CURRENT_USER, 184 if (hkcu_key_.Create(HKEY_CURRENT_USER,
185 webkit::npapi::kRegistryMozillaPlugins, 185 webkit::npapi::kRegistryMozillaPlugins,
186 KEY_NOTIFY) == ERROR_SUCCESS) { 186 KEY_NOTIFY) == ERROR_SUCCESS) {
187 if (hkcu_key_.StartWatching() == ERROR_SUCCESS) { 187 if (hkcu_key_.StartWatching() == ERROR_SUCCESS) {
188 hkcu_event_.reset(new base::WaitableEvent(hkcu_key_.watch_event())); 188 hkcu_event_.reset(new base::WaitableEvent(hkcu_key_.watch_event()));
189 base::WaitableEventWatcher::EventCallback callback = 189 hkcu_watcher_.StartWatching(hkcu_event_.get(), this);
190 base::Bind(&PluginServiceImpl::OnWaitableEventSignaled,
191 base::Unretained(this));
192 hkcu_watcher_.StartWatching(hkcu_event_.get(), callback);
193 } 190 }
194 } 191 }
195 if (hklm_key_.Create(HKEY_LOCAL_MACHINE, 192 if (hklm_key_.Create(HKEY_LOCAL_MACHINE,
196 webkit::npapi::kRegistryMozillaPlugins, 193 webkit::npapi::kRegistryMozillaPlugins,
197 KEY_NOTIFY) == ERROR_SUCCESS) { 194 KEY_NOTIFY) == ERROR_SUCCESS) {
198 if (hklm_key_.StartWatching() == ERROR_SUCCESS) { 195 if (hklm_key_.StartWatching() == ERROR_SUCCESS) {
199 hklm_event_.reset(new base::WaitableEvent(hklm_key_.watch_event())); 196 hklm_event_.reset(new base::WaitableEvent(hklm_key_.watch_event()));
200 base::WaitableEventWatcher::EventCallback callback = 197 hklm_watcher_.StartWatching(hklm_event_.get(), this);
201 base::Bind(&PluginServiceImpl::OnWaitableEventSignaled,
202 base::Unretained(this));
203 hklm_watcher_.StartWatching(hklm_event_.get(), callback);
204 } 198 }
205 } 199 }
206 #endif 200 #endif
207 #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID) 201 #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID)
208 // On ChromeOS the user can't install plugins anyway and on Windows all 202 // On ChromeOS the user can't install plugins anyway and on Windows all
209 // important plugins register themselves in the registry so no need to do that. 203 // important plugins register themselves in the registry so no need to do that.
210 204
211 // Get the list of all paths for registering the FilePathWatchers 205 // Get the list of all paths for registering the FilePathWatchers
212 // that will track and if needed reload the list of plugins on runtime. 206 // that will track and if needed reload the list of plugins on runtime.
213 std::vector<FilePath> plugin_dirs; 207 std::vector<FilePath> plugin_dirs;
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 void PluginServiceImpl::GetInternalPlugins( 720 void PluginServiceImpl::GetInternalPlugins(
727 std::vector<webkit::WebPluginInfo>* plugins) { 721 std::vector<webkit::WebPluginInfo>* plugins) {
728 plugin_list_->GetInternalPlugins(plugins); 722 plugin_list_->GetInternalPlugins(plugins);
729 } 723 }
730 724
731 webkit::npapi::PluginList* PluginServiceImpl::GetPluginList() { 725 webkit::npapi::PluginList* PluginServiceImpl::GetPluginList() {
732 return plugin_list_; 726 return plugin_list_;
733 } 727 }
734 728
735 } // namespace content 729 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/plugin_service_impl.h ('k') | ipc/ipc_sync_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698