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 #undef LOG | 5 #undef LOG |
6 | 6 |
7 #include "webkit/tools/test_shell/test_shell.h" | 7 #include "webkit/tools/test_shell/test_shell.h" |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" | 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" |
42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h" | 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h" |
43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
44 #include "ui/gfx/codec/png_codec.h" | 44 #include "ui/gfx/codec/png_codec.h" |
45 #include "ui/gfx/size.h" | 45 #include "ui/gfx/size.h" |
46 #include "webkit/glue/glue_serialize.h" | 46 #include "webkit/glue/glue_serialize.h" |
47 #include "webkit/glue/user_agent.h" | 47 #include "webkit/glue/user_agent.h" |
48 #include "webkit/glue/webkit_glue.h" | 48 #include "webkit/glue/webkit_glue.h" |
49 #include "webkit/glue/webpreferences.h" | 49 #include "webkit/glue/webpreferences.h" |
50 #include "webkit/plugins/npapi/plugin_list.h" | 50 #include "webkit/plugins/npapi/plugin_list.h" |
| 51 #include "webkit/plugins/ppapi/ppapi_plugin_list.h" |
51 #include "webkit/plugins/webplugininfo.h" | 52 #include "webkit/plugins/webplugininfo.h" |
52 #include "webkit/tools/test_shell/notification_presenter.h" | 53 #include "webkit/tools/test_shell/notification_presenter.h" |
53 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" | 54 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" |
54 #include "webkit/tools/test_shell/test_navigation_controller.h" | 55 #include "webkit/tools/test_shell/test_navigation_controller.h" |
55 #include "webkit/tools/test_shell/test_shell_devtools_agent.h" | 56 #include "webkit/tools/test_shell/test_shell_devtools_agent.h" |
56 #include "webkit/tools/test_shell/test_shell_devtools_client.h" | 57 #include "webkit/tools/test_shell/test_shell_devtools_client.h" |
57 #include "webkit/tools/test_shell/test_shell_request_context.h" | 58 #include "webkit/tools/test_shell/test_shell_request_context.h" |
58 #include "webkit/tools/test_shell/test_shell_switches.h" | 59 #include "webkit/tools/test_shell/test_shell_switches.h" |
59 #include "webkit/tools/test_shell/test_webview_delegate.h" | 60 #include "webkit/tools/test_shell/test_webview_delegate.h" |
60 | 61 |
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 bool GetFontTable(int fd, uint32_t table, uint8_t* output, | 657 bool GetFontTable(int fd, uint32_t table, uint8_t* output, |
657 size_t* output_length) { | 658 size_t* output_length) { |
658 return false; | 659 return false; |
659 } | 660 } |
660 #endif | 661 #endif |
661 | 662 |
662 void GetPlugins(bool refresh, | 663 void GetPlugins(bool refresh, |
663 std::vector<webkit::WebPluginInfo>* plugins) { | 664 std::vector<webkit::WebPluginInfo>* plugins) { |
664 if (refresh) | 665 if (refresh) |
665 webkit::npapi::PluginList::Singleton()->RefreshPlugins(); | 666 webkit::npapi::PluginList::Singleton()->RefreshPlugins(); |
| 667 |
| 668 // Pepper plugins. |
| 669 const std::vector<webkit::ppapi::PluginInfo>& ppapi_plugins = |
| 670 webkit::ppapi::PluginList::GetInstance()->plugin_list(); |
| 671 for (size_t i = 0; i < ppapi_plugins.size(); ++i) { |
| 672 webkit::WebPluginInfo plugin_info; |
| 673 webkit::ppapi::PepperToWebPluginInfo(ppapi_plugins[i], &plugin_info); |
| 674 webkit::npapi::PluginList::Singleton()->RegisterInternalPlugin(plugin_info); |
| 675 } |
| 676 webkit::ppapi::PluginList::GetInstance()->LoadModules(); |
| 677 |
666 webkit::npapi::PluginList::Singleton()->GetPlugins(plugins); | 678 webkit::npapi::PluginList::Singleton()->GetPlugins(plugins); |
667 // Don't load the forked TestNetscapePlugIn in the chromium code, use | 679 // Don't load the forked TestNetscapePlugIn in the chromium code, use |
668 // the copy in webkit.org's repository instead. | 680 // the copy in webkit.org's repository instead. |
669 const FilePath::StringType kPluginBlackList[] = { | 681 const FilePath::StringType kPluginBlackList[] = { |
670 FILE_PATH_LITERAL("npapi_layout_test_plugin.dll"), | 682 FILE_PATH_LITERAL("npapi_layout_test_plugin.dll"), |
671 FILE_PATH_LITERAL("WebKitTestNetscapePlugIn.plugin"), | 683 FILE_PATH_LITERAL("WebKitTestNetscapePlugIn.plugin"), |
672 FILE_PATH_LITERAL("libnpapi_layout_test_plugin.so"), | 684 FILE_PATH_LITERAL("libnpapi_layout_test_plugin.so"), |
673 }; | 685 }; |
674 for (int i = plugins->size() - 1; i >= 0; --i) { | 686 for (int i = plugins->size() - 1; i >= 0; --i) { |
675 webkit::WebPluginInfo plugin_info = plugins->at(i); | 687 webkit::WebPluginInfo plugin_info = plugins->at(i); |
676 for (size_t j = 0; j < arraysize(kPluginBlackList); ++j) { | 688 for (size_t j = 0; j < arraysize(kPluginBlackList); ++j) { |
677 if (plugin_info.path.BaseName() == FilePath(kPluginBlackList[j])) { | 689 if (plugin_info.path.BaseName() == FilePath(kPluginBlackList[j])) { |
678 plugins->erase(plugins->begin() + i); | 690 plugins->erase(plugins->begin() + i); |
679 } | 691 } |
680 } | 692 } |
681 } | 693 } |
682 } | 694 } |
683 | 695 |
684 } // namespace webkit_glue | 696 } // namespace webkit_glue |
OLD | NEW |