Chromium Code Reviews| 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 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 834 return false; | 834 return false; |
| 835 } | 835 } |
| 836 | 836 |
| 837 bool PluginServiceImpl::GetPluginInfoFromWindow( | 837 bool PluginServiceImpl::GetPluginInfoFromWindow( |
| 838 HWND window, | 838 HWND window, |
| 839 base::string16* plugin_name, | 839 base::string16* plugin_name, |
| 840 base::string16* plugin_version) { | 840 base::string16* plugin_version) { |
| 841 if (!IsPluginWindow(window)) | 841 if (!IsPluginWindow(window)) |
| 842 return false; | 842 return false; |
| 843 | 843 |
| 844 GetPluginPropertyFromWindow( | 844 |
| 845 window, kPluginNameAtomProperty, plugin_name); | 845 DWORD process_id = 0; |
| 846 GetPluginPropertyFromWindow( | 846 GetWindowThreadProcessId(window, &process_id); |
| 847 window, kPluginVersionAtomProperty, plugin_version); | 847 WebPluginInfo info; |
| 848 if (!PluginProcessHost::GetWebPluginInfoFromPluginPid(process_id, &info)) | |
|
brettw
2014/09/10 00:17:27
I'm surprised this doesn't give you an error about
jam
2014/09/10 01:15:20
Done.
| |
| 849 return false; | |
| 850 | |
| 851 *plugin_name = info.name; | |
| 852 *plugin_version = info.version; | |
| 848 return true; | 853 return true; |
| 849 } | 854 } |
| 850 | 855 |
| 851 bool PluginServiceImpl::IsPluginWindow(HWND window) { | 856 bool PluginServiceImpl::IsPluginWindow(HWND window) { |
| 852 return gfx::GetClassName(window) == base::string16(kNativeWindowClassName); | 857 return gfx::GetClassName(window) == base::string16(kNativeWindowClassName); |
| 853 } | 858 } |
| 854 #endif | 859 #endif |
| 855 | 860 |
| 856 bool PluginServiceImpl::PpapiDevChannelSupported( | 861 bool PluginServiceImpl::PpapiDevChannelSupported( |
| 857 BrowserContext* browser_context, | 862 BrowserContext* browser_context, |
| 858 const GURL& document_url) { | 863 const GURL& document_url) { |
| 859 return content::GetContentClient()->browser()-> | 864 return content::GetContentClient()->browser()-> |
| 860 IsPluginAllowedToUseDevChannelAPIs(browser_context, document_url); | 865 IsPluginAllowedToUseDevChannelAPIs(browser_context, document_url); |
| 861 } | 866 } |
| 862 | 867 |
| 863 } // namespace content | 868 } // namespace content |
| OLD | NEW |