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 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
674 WebPluginInfo webplugin_info; | 674 WebPluginInfo webplugin_info; |
675 if (!GetPluginInfoByPath(plugin_path, &webplugin_info)) | 675 if (!GetPluginInfoByPath(plugin_path, &webplugin_info)) |
676 return NULL; | 676 return NULL; |
677 PepperPluginInfo new_pepper_info; | 677 PepperPluginInfo new_pepper_info; |
678 if (!MakePepperPluginInfo(webplugin_info, &new_pepper_info)) | 678 if (!MakePepperPluginInfo(webplugin_info, &new_pepper_info)) |
679 return NULL; | 679 return NULL; |
680 ppapi_plugins_.push_back(new_pepper_info); | 680 ppapi_plugins_.push_back(new_pepper_info); |
681 return &ppapi_plugins_[ppapi_plugins_.size() - 1]; | 681 return &ppapi_plugins_[ppapi_plugins_.size() - 1]; |
682 } | 682 } |
683 | 683 |
684 bool PluginServiceImpl::IsPepperPluginRegisteredForMimeType( | |
685 const std::string& mime_type) { | |
686 for (size_t i = 0; i < ppapi_plugins_.size(); i++) { | |
scherkus (not reviewing)
2013/09/16 17:42:05
nit: ++i (rest of this file is consistent with tha
ddorwin
2013/09/16 18:28:58
Done.
| |
687 const std::vector<WebPluginMimeType> & mime_types = | |
scherkus (not reviewing)
2013/09/16 17:42:05
nit: remove space before &
ddorwin
2013/09/16 18:28:58
Done.
| |
688 ppapi_plugins_[i].mime_types; | |
689 for (size_t j = 0; j < mime_types.size(); j++) { | |
scherkus (not reviewing)
2013/09/16 17:42:05
nit: ++j
ddorwin
2013/09/16 18:28:58
Done.
| |
690 if (mime_types[j].mime_type == mime_type) | |
691 return true; | |
692 } | |
693 } | |
694 | |
695 return false; | |
696 } | |
697 | |
684 #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID) | 698 #if defined(OS_POSIX) && !defined(OS_OPENBSD) && !defined(OS_ANDROID) |
685 // static | 699 // static |
686 void PluginServiceImpl::RegisterFilePathWatcher(FilePathWatcher* watcher, | 700 void PluginServiceImpl::RegisterFilePathWatcher(FilePathWatcher* watcher, |
687 const base::FilePath& path) { | 701 const base::FilePath& path) { |
688 bool result = watcher->Watch(path, false, | 702 bool result = watcher->Watch(path, false, |
689 base::Bind(&NotifyPluginDirChanged)); | 703 base::Bind(&NotifyPluginDirChanged)); |
690 DCHECK(result); | 704 DCHECK(result); |
691 } | 705 } |
692 #endif | 706 #endif |
693 | 707 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
835 window, kPluginVersionAtomProperty, plugin_version); | 849 window, kPluginVersionAtomProperty, plugin_version); |
836 return true; | 850 return true; |
837 } | 851 } |
838 | 852 |
839 bool PluginServiceImpl::IsPluginWindow(HWND window) { | 853 bool PluginServiceImpl::IsPluginWindow(HWND window) { |
840 return gfx::GetClassName(window) == base::string16(kNativeWindowClassName); | 854 return gfx::GetClassName(window) == base::string16(kNativeWindowClassName); |
841 } | 855 } |
842 #endif | 856 #endif |
843 | 857 |
844 } // namespace content | 858 } // namespace content |
OLD | NEW |