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 <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" |
11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
12 #include "base/threading/thread.h" | 12 #include "base/threading/thread.h" |
13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
14 #include "base/values.h" | 14 #include "base/values.h" |
15 #include "base/synchronization/waitable_event.h" | 15 #include "base/synchronization/waitable_event.h" |
16 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
17 #include "chrome/browser/chrome_plugin_host.h" | 17 #include "chrome/browser/chrome_plugin_host.h" |
18 #include "chrome/browser/extensions/extension_service.h" | 18 #include "chrome/browser/extensions/extension_service.h" |
19 #include "chrome/browser/plugin_updater.h" | 19 #include "chrome/browser/plugin_updater.h" |
20 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
21 #include "chrome/common/chrome_plugin_lib.h" | 21 #include "chrome/common/chrome_plugin_lib.h" |
22 #include "chrome/common/chrome_paths.h" | 22 #include "chrome/common/chrome_paths.h" |
23 #include "chrome/common/chrome_switches.h" | 23 #include "chrome/common/chrome_switches.h" |
24 #include "chrome/common/default_plugin.h" | 24 #include "chrome/common/default_plugin.h" |
25 #include "chrome/common/extensions/extension.h" | 25 #include "chrome/common/extensions/extension.h" |
| 26 #include "chrome/common/gpu_plugin.h" |
26 #include "chrome/common/logging_chrome.h" | 27 #include "chrome/common/logging_chrome.h" |
27 #include "chrome/common/notification_type.h" | 28 #include "chrome/common/notification_type.h" |
28 #include "chrome/common/notification_service.h" | 29 #include "chrome/common/notification_service.h" |
29 #include "chrome/common/pepper_plugin_registry.h" | 30 #include "chrome/common/pepper_plugin_registry.h" |
30 #include "chrome/common/plugin_messages.h" | 31 #include "chrome/common/plugin_messages.h" |
31 #include "chrome/common/render_messages.h" | 32 #include "chrome/common/render_messages.h" |
32 #include "content/browser/browser_thread.h" | 33 #include "content/browser/browser_thread.h" |
33 #include "content/browser/ppapi_plugin_process_host.h" | 34 #include "content/browser/ppapi_plugin_process_host.h" |
34 #include "content/browser/renderer_host/render_process_host.h" | 35 #include "content/browser/renderer_host/render_process_host.h" |
35 #include "content/browser/renderer_host/render_view_host.h" | 36 #include "content/browser/renderer_host/render_view_host.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 switches::kDisableInternalFlash) && | 127 switches::kDisableInternalFlash) && |
127 PathService::Get(chrome::FILE_FLASH_PLUGIN, &path)) { | 128 PathService::Get(chrome::FILE_FLASH_PLUGIN, &path)) { |
128 webkit::npapi::PluginList::Singleton()->AddExtraPluginPath(path); | 129 webkit::npapi::PluginList::Singleton()->AddExtraPluginPath(path); |
129 } | 130 } |
130 | 131 |
131 #if defined(OS_CHROMEOS) | 132 #if defined(OS_CHROMEOS) |
132 plugin_selection_policy_ = new chromeos::PluginSelectionPolicy; | 133 plugin_selection_policy_ = new chromeos::PluginSelectionPolicy; |
133 plugin_selection_policy_->StartInit(); | 134 plugin_selection_policy_->StartInit(); |
134 #endif | 135 #endif |
135 | 136 |
| 137 chrome::RegisterInternalGPUPlugin(); |
| 138 |
136 // Start watching for changes in the plugin list. This means watching | 139 // Start watching for changes in the plugin list. This means watching |
137 // for changes in the Windows registry keys and on both Windows and POSIX | 140 // for changes in the Windows registry keys and on both Windows and POSIX |
138 // watch for changes in the paths that are expected to contain plugins. | 141 // watch for changes in the paths that are expected to contain plugins. |
139 #if defined(OS_WIN) | 142 #if defined(OS_WIN) |
140 hkcu_key_.Create( | 143 hkcu_key_.Create( |
141 HKEY_CURRENT_USER, webkit::npapi::kRegistryMozillaPlugins, KEY_NOTIFY); | 144 HKEY_CURRENT_USER, webkit::npapi::kRegistryMozillaPlugins, KEY_NOTIFY); |
142 hklm_key_.Create( | 145 hklm_key_.Create( |
143 HKEY_LOCAL_MACHINE, webkit::npapi::kRegistryMozillaPlugins, KEY_NOTIFY); | 146 HKEY_LOCAL_MACHINE, webkit::npapi::kRegistryMozillaPlugins, KEY_NOTIFY); |
144 if (hkcu_key_.StartWatching() == ERROR_SUCCESS) { | 147 if (hkcu_key_.StartWatching() == ERROR_SUCCESS) { |
145 hkcu_event_.reset(new base::WaitableEvent(hkcu_key_.watch_event())); | 148 hkcu_event_.reset(new base::WaitableEvent(hkcu_key_.watch_event())); |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 #if defined(OS_LINUX) | 593 #if defined(OS_LINUX) |
591 // static | 594 // static |
592 void PluginService::RegisterFilePathWatcher( | 595 void PluginService::RegisterFilePathWatcher( |
593 FilePathWatcher *watcher, | 596 FilePathWatcher *watcher, |
594 const FilePath& path, | 597 const FilePath& path, |
595 FilePathWatcher::Delegate* delegate) { | 598 FilePathWatcher::Delegate* delegate) { |
596 bool result = watcher->Watch(path, delegate); | 599 bool result = watcher->Watch(path, delegate); |
597 DCHECK(result); | 600 DCHECK(result); |
598 } | 601 } |
599 #endif | 602 #endif |
OLD | NEW |