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" | |
27 #include "chrome/common/logging_chrome.h" | 26 #include "chrome/common/logging_chrome.h" |
28 #include "chrome/common/notification_type.h" | 27 #include "chrome/common/notification_type.h" |
29 #include "chrome/common/notification_service.h" | 28 #include "chrome/common/notification_service.h" |
30 #include "chrome/common/pepper_plugin_registry.h" | 29 #include "chrome/common/pepper_plugin_registry.h" |
31 #include "chrome/common/plugin_messages.h" | 30 #include "chrome/common/plugin_messages.h" |
32 #include "chrome/common/render_messages.h" | 31 #include "chrome/common/render_messages.h" |
33 #include "content/browser/browser_thread.h" | 32 #include "content/browser/browser_thread.h" |
34 #include "content/browser/ppapi_plugin_process_host.h" | 33 #include "content/browser/ppapi_plugin_process_host.h" |
35 #include "content/browser/renderer_host/render_process_host.h" | 34 #include "content/browser/renderer_host/render_process_host.h" |
36 #include "content/browser/renderer_host/render_view_host.h" | 35 #include "content/browser/renderer_host/render_view_host.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 switches::kDisableInternalFlash) && | 126 switches::kDisableInternalFlash) && |
128 PathService::Get(chrome::FILE_FLASH_PLUGIN, &path)) { | 127 PathService::Get(chrome::FILE_FLASH_PLUGIN, &path)) { |
129 webkit::npapi::PluginList::Singleton()->AddExtraPluginPath(path); | 128 webkit::npapi::PluginList::Singleton()->AddExtraPluginPath(path); |
130 } | 129 } |
131 | 130 |
132 #if defined(OS_CHROMEOS) | 131 #if defined(OS_CHROMEOS) |
133 plugin_selection_policy_ = new chromeos::PluginSelectionPolicy; | 132 plugin_selection_policy_ = new chromeos::PluginSelectionPolicy; |
134 plugin_selection_policy_->StartInit(); | 133 plugin_selection_policy_->StartInit(); |
135 #endif | 134 #endif |
136 | 135 |
137 chrome::RegisterInternalGPUPlugin(); | |
138 | |
139 // Start watching for changes in the plugin list. This means watching | 136 // Start watching for changes in the plugin list. This means watching |
140 // for changes in the Windows registry keys and on both Windows and POSIX | 137 // for changes in the Windows registry keys and on both Windows and POSIX |
141 // watch for changes in the paths that are expected to contain plugins. | 138 // watch for changes in the paths that are expected to contain plugins. |
142 #if defined(OS_WIN) | 139 #if defined(OS_WIN) |
143 hkcu_key_.Create( | 140 hkcu_key_.Create( |
144 HKEY_CURRENT_USER, webkit::npapi::kRegistryMozillaPlugins, KEY_NOTIFY); | 141 HKEY_CURRENT_USER, webkit::npapi::kRegistryMozillaPlugins, KEY_NOTIFY); |
145 hklm_key_.Create( | 142 hklm_key_.Create( |
146 HKEY_LOCAL_MACHINE, webkit::npapi::kRegistryMozillaPlugins, KEY_NOTIFY); | 143 HKEY_LOCAL_MACHINE, webkit::npapi::kRegistryMozillaPlugins, KEY_NOTIFY); |
147 if (hkcu_key_.StartWatching() == ERROR_SUCCESS) { | 144 if (hkcu_key_.StartWatching() == ERROR_SUCCESS) { |
148 hkcu_event_.reset(new base::WaitableEvent(hkcu_key_.watch_event())); | 145 hkcu_event_.reset(new base::WaitableEvent(hkcu_key_.watch_event())); |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 #if defined(OS_LINUX) | 573 #if defined(OS_LINUX) |
577 // static | 574 // static |
578 void PluginService::RegisterFilePathWatcher( | 575 void PluginService::RegisterFilePathWatcher( |
579 FilePathWatcher *watcher, | 576 FilePathWatcher *watcher, |
580 const FilePath& path, | 577 const FilePath& path, |
581 FilePathWatcher::Delegate* delegate) { | 578 FilePathWatcher::Delegate* delegate) { |
582 bool result = watcher->Watch(path, delegate); | 579 bool result = watcher->Watch(path, delegate); |
583 DCHECK(result); | 580 DCHECK(result); |
584 } | 581 } |
585 #endif | 582 #endif |
OLD | NEW |