OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 5 #include "content/browser/plugin_service.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" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "base/message_loop_proxy.h" | 12 #include "base/message_loop_proxy.h" |
13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
15 #include "base/synchronization/waitable_event.h" | 15 #include "base/synchronization/waitable_event.h" |
16 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" |
17 #include "base/utf_string_conversions.h" | 17 #include "base/utf_string_conversions.h" |
18 #include "base/values.h" | 18 #include "base/values.h" |
19 #include "content/browser/browser_thread.h" | 19 #include "content/browser/browser_thread.h" |
20 #include "content/browser/plugin_loader_posix.h" | 20 #include "content/browser/plugin_loader_posix.h" |
21 #include "content/browser/plugin_service_filter.h" | 21 #include "content/browser/plugin_service_filter.h" |
22 #include "content/browser/ppapi_plugin_process_host.h" | 22 #include "content/browser/ppapi_plugin_process_host.h" |
23 #include "content/browser/renderer_host/render_process_host.h" | 23 #include "content/browser/renderer_host/render_process_host.h" |
24 #include "content/browser/renderer_host/render_view_host.h" | 24 #include "content/browser/renderer_host/render_view_host.h" |
25 #include "content/browser/resource_context.h" | 25 #include "content/browser/resource_context.h" |
26 #include "content/browser/utility_process_host.h" | 26 #include "content/browser/utility_process_host.h" |
27 #include "content/common/notification_service.h" | 27 #include "content/public/browser/notification_service.h" |
28 #include "content/common/pepper_plugin_registry.h" | 28 #include "content/common/pepper_plugin_registry.h" |
29 #include "content/common/plugin_messages.h" | 29 #include "content/common/plugin_messages.h" |
30 #include "content/common/utility_messages.h" | 30 #include "content/common/utility_messages.h" |
31 #include "content/common/view_messages.h" | 31 #include "content/common/view_messages.h" |
32 #include "content/public/browser/content_browser_client.h" | 32 #include "content/public/browser/content_browser_client.h" |
33 #include "content/public/browser/notification_types.h" | 33 #include "content/public/browser/notification_types.h" |
34 #include "content/public/common/content_switches.h" | 34 #include "content/public/common/content_switches.h" |
35 #include "webkit/plugins/npapi/plugin_constants_win.h" | 35 #include "webkit/plugins/npapi/plugin_constants_win.h" |
36 #include "webkit/plugins/npapi/plugin_group.h" | 36 #include "webkit/plugins/npapi/plugin_group.h" |
37 #include "webkit/plugins/npapi/plugin_list.h" | 37 #include "webkit/plugins/npapi/plugin_list.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 if (!path.empty()) | 124 if (!path.empty()) |
125 webkit::npapi::PluginList::Singleton()->AddExtraPluginPath(path); | 125 webkit::npapi::PluginList::Singleton()->AddExtraPluginPath(path); |
126 path = command_line->GetSwitchValuePath(switches::kExtraPluginDir); | 126 path = command_line->GetSwitchValuePath(switches::kExtraPluginDir); |
127 if (!path.empty()) | 127 if (!path.empty()) |
128 webkit::npapi::PluginList::Singleton()->AddExtraPluginDir(path); | 128 webkit::npapi::PluginList::Singleton()->AddExtraPluginDir(path); |
129 | 129 |
130 #if defined(OS_MACOSX) | 130 #if defined(OS_MACOSX) |
131 // We need to know when the browser comes forward so we can bring modal plugin | 131 // We need to know when the browser comes forward so we can bring modal plugin |
132 // windows forward too. | 132 // windows forward too. |
133 registrar_.Add(this, content::NOTIFICATION_APP_ACTIVATED, | 133 registrar_.Add(this, content::NOTIFICATION_APP_ACTIVATED, |
134 NotificationService::AllSources()); | 134 content::NotificationService::AllSources()); |
135 #endif | 135 #endif |
136 } | 136 } |
137 | 137 |
138 PluginService::~PluginService() { | 138 PluginService::~PluginService() { |
139 #if defined(OS_WIN) | 139 #if defined(OS_WIN) |
140 // Release the events since they're owned by RegKey, not WaitableEvent. | 140 // Release the events since they're owned by RegKey, not WaitableEvent. |
141 hkcu_watcher_.StopWatching(); | 141 hkcu_watcher_.StopWatching(); |
142 hklm_watcher_.StopWatching(); | 142 hklm_watcher_.StopWatching(); |
143 if (hkcu_event_.get()) | 143 if (hkcu_event_.get()) |
144 hkcu_event_->Release(); | 144 hkcu_event_->Release(); |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 610 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
611 // static | 611 // static |
612 void PluginService::RegisterFilePathWatcher( | 612 void PluginService::RegisterFilePathWatcher( |
613 FilePathWatcher *watcher, | 613 FilePathWatcher *watcher, |
614 const FilePath& path, | 614 const FilePath& path, |
615 FilePathWatcher::Delegate* delegate) { | 615 FilePathWatcher::Delegate* delegate) { |
616 bool result = watcher->Watch(path, delegate); | 616 bool result = watcher->Watch(path, delegate); |
617 DCHECK(result); | 617 DCHECK(result); |
618 } | 618 } |
619 #endif | 619 #endif |
OLD | NEW |