| OLD | NEW |
| 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/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 base::win::RegKey::ChangeCallback callback = | 194 base::win::RegKey::ChangeCallback callback = |
| 195 base::Bind(&PluginServiceImpl::OnKeyChanged, base::Unretained(this), | 195 base::Bind(&PluginServiceImpl::OnKeyChanged, base::Unretained(this), |
| 196 base::Unretained(&hkcu_key_)); | 196 base::Unretained(&hkcu_key_)); |
| 197 hkcu_key_.StartWatching(callback); | 197 hkcu_key_.StartWatching(callback); |
| 198 } | 198 } |
| 199 if (hklm_key_.Create(HKEY_LOCAL_MACHINE, | 199 if (hklm_key_.Create(HKEY_LOCAL_MACHINE, |
| 200 kRegistryMozillaPlugins, | 200 kRegistryMozillaPlugins, |
| 201 KEY_NOTIFY) == ERROR_SUCCESS) { | 201 KEY_NOTIFY) == ERROR_SUCCESS) { |
| 202 base::win::RegKey::ChangeCallback callback = | 202 base::win::RegKey::ChangeCallback callback = |
| 203 base::Bind(&PluginServiceImpl::OnKeyChanged, base::Unretained(this), | 203 base::Bind(&PluginServiceImpl::OnKeyChanged, base::Unretained(this), |
| 204 base::Unretained(&hkcu_key_)); | 204 base::Unretained(&hklm_key_)); |
| 205 hklm_key_.StartWatching(callback); | 205 hklm_key_.StartWatching(callback); |
| 206 } | 206 } |
| 207 #endif | 207 #endif |
| 208 #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID) | 208 #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID) |
| 209 // On ChromeOS the user can't install plugins anyway and on Windows all | 209 // On ChromeOS the user can't install plugins anyway and on Windows all |
| 210 // important plugins register themselves in the registry so no need to do that. | 210 // important plugins register themselves in the registry so no need to do that. |
| 211 | 211 |
| 212 // Get the list of all paths for registering the FilePathWatchers | 212 // Get the list of all paths for registering the FilePathWatchers |
| 213 // that will track and if needed reload the list of plugins on runtime. | 213 // that will track and if needed reload the list of plugins on runtime. |
| 214 std::vector<base::FilePath> plugin_dirs; | 214 std::vector<base::FilePath> plugin_dirs; |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 | 624 |
| 625 plugin_loader_->GetPlugins( | 625 plugin_loader_->GetPlugins( |
| 626 base::Bind(&ForwardCallback, make_scoped_refptr(target_loop), callback)); | 626 base::Bind(&ForwardCallback, make_scoped_refptr(target_loop), callback)); |
| 627 } | 627 } |
| 628 #endif | 628 #endif |
| 629 | 629 |
| 630 #if defined(OS_WIN) | 630 #if defined(OS_WIN) |
| 631 void PluginServiceImpl::OnKeyChanged(base::win::RegKey* key) { | 631 void PluginServiceImpl::OnKeyChanged(base::win::RegKey* key) { |
| 632 key->StartWatching(base::Bind(&PluginServiceImpl::OnKeyChanged, | 632 key->StartWatching(base::Bind(&PluginServiceImpl::OnKeyChanged, |
| 633 base::Unretained(this), | 633 base::Unretained(this), |
| 634 base::Unretained(&hkcu_key_))); | 634 base::Unretained(key))); |
| 635 | 635 |
| 636 PluginList::Singleton()->RefreshPlugins(); | 636 PluginList::Singleton()->RefreshPlugins(); |
| 637 PurgePluginListCache(NULL, false); | 637 PurgePluginListCache(NULL, false); |
| 638 } | 638 } |
| 639 #endif // defined(OS_WIN) | 639 #endif // defined(OS_WIN) |
| 640 | 640 |
| 641 void PluginServiceImpl::RegisterPepperPlugins() { | 641 void PluginServiceImpl::RegisterPepperPlugins() { |
| 642 ComputePepperPluginList(&ppapi_plugins_); | 642 ComputePepperPluginList(&ppapi_plugins_); |
| 643 for (size_t i = 0; i < ppapi_plugins_.size(); ++i) { | 643 for (size_t i = 0; i < ppapi_plugins_.size(); ++i) { |
| 644 RegisterInternalPlugin(ppapi_plugins_[i].ToWebPluginInfo(), true); | 644 RegisterInternalPlugin(ppapi_plugins_[i].ToWebPluginInfo(), true); |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 #endif | 838 #endif |
| 839 | 839 |
| 840 bool PluginServiceImpl::PpapiDevChannelSupported( | 840 bool PluginServiceImpl::PpapiDevChannelSupported( |
| 841 BrowserContext* browser_context, | 841 BrowserContext* browser_context, |
| 842 const GURL& document_url) { | 842 const GURL& document_url) { |
| 843 return content::GetContentClient()->browser()-> | 843 return content::GetContentClient()->browser()-> |
| 844 IsPluginAllowedToUseDevChannelAPIs(browser_context, document_url); | 844 IsPluginAllowedToUseDevChannelAPIs(browser_context, document_url); |
| 845 } | 845 } |
| 846 | 846 |
| 847 } // namespace content | 847 } // namespace content |
| OLD | NEW |