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/renderer/renderer_webkitplatformsupport_impl.h" | 5 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
11 #include "base/message_loop/message_loop_proxy.h" | 11 #include "base/message_loop/message_loop_proxy.h" |
12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
13 #include "base/platform_file.h" | 13 #include "base/platform_file.h" |
14 #include "base/safe_numerics.h" | 14 #include "base/safe_numerics.h" |
15 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
17 #include "content/child/database_util.h" | 17 #include "content/child/database_util.h" |
18 #include "content/child/fileapi/webfilesystem_impl.h" | 18 #include "content/child/fileapi/webfilesystem_impl.h" |
19 #include "content/child/indexed_db/proxy_webidbfactory_impl.h" | 19 #include "content/child/indexed_db/proxy_webidbfactory_impl.h" |
20 #include "content/child/npapi/npobject_util.h" | 20 #include "content/child/npapi/npobject_util.h" |
21 #include "content/child/thread_safe_sender.h" | 21 #include "content/child/thread_safe_sender.h" |
22 #include "content/child/webblobregistry_impl.h" | 22 #include "content/child/webblobregistry_impl.h" |
23 #include "content/child/webmessageportchannel_impl.h" | 23 #include "content/child/webmessageportchannel_impl.h" |
24 #include "content/common/file_utilities_messages.h" | 24 #include "content/common/file_utilities_messages.h" |
25 #include "content/common/gpu/client/context_provider_command_buffer.h" | 25 #include "content/common/gpu/client/context_provider_command_buffer.h" |
26 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 26 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
27 #include "content/common/mime_registry_messages.h" | 27 #include "content/common/mime_registry_messages.h" |
28 #include "content/common/view_messages.h" | 28 #include "content/common/view_messages.h" |
29 #include "content/public/common/content_switches.h" | 29 #include "content/public/common/content_switches.h" |
| 30 #include "content/public/common/webplugininfo.h" |
30 #include "content/public/renderer/content_renderer_client.h" | 31 #include "content/public/renderer/content_renderer_client.h" |
31 #include "content/renderer/device_orientation/device_motion_event_pump.h" | 32 #include "content/renderer/device_orientation/device_motion_event_pump.h" |
32 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" | 33 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" |
33 #include "content/renderer/gamepad_shared_memory_reader.h" | 34 #include "content/renderer/gamepad_shared_memory_reader.h" |
34 #include "content/renderer/hyphenator/hyphenator.h" | 35 #include "content/renderer/hyphenator/hyphenator.h" |
35 #include "content/renderer/media/audio_decoder.h" | 36 #include "content/renderer/media/audio_decoder.h" |
36 #include "content/renderer/media/crypto/key_systems.h" | 37 #include "content/renderer/media/crypto/key_systems.h" |
37 #include "content/renderer/media/media_stream_dependency_factory.h" | 38 #include "content/renderer/media/media_stream_dependency_factory.h" |
38 #include "content/renderer/media/renderer_webaudiodevice_impl.h" | 39 #include "content/renderer/media/renderer_webaudiodevice_impl.h" |
39 #include "content/renderer/media/renderer_webmidiaccessor_impl.h" | 40 #include "content/renderer/media/renderer_webmidiaccessor_impl.h" |
(...skipping 20 matching lines...) Expand all Loading... |
60 #include "third_party/WebKit/public/platform/WebPluginListBuilder.h" | 61 #include "third_party/WebKit/public/platform/WebPluginListBuilder.h" |
61 #include "third_party/WebKit/public/platform/WebURL.h" | 62 #include "third_party/WebKit/public/platform/WebURL.h" |
62 #include "third_party/WebKit/public/platform/WebVector.h" | 63 #include "third_party/WebKit/public/platform/WebVector.h" |
63 #include "third_party/WebKit/public/web/WebFrame.h" | 64 #include "third_party/WebKit/public/web/WebFrame.h" |
64 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 65 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
65 #include "url/gurl.h" | 66 #include "url/gurl.h" |
66 #include "webkit/common/gpu/webgraphicscontext3d_provider_impl.h" | 67 #include "webkit/common/gpu/webgraphicscontext3d_provider_impl.h" |
67 #include "webkit/glue/simple_webmimeregistry_impl.h" | 68 #include "webkit/glue/simple_webmimeregistry_impl.h" |
68 #include "webkit/glue/webfileutilities_impl.h" | 69 #include "webkit/glue/webfileutilities_impl.h" |
69 #include "webkit/glue/webkit_glue.h" | 70 #include "webkit/glue/webkit_glue.h" |
70 #include "webkit/plugins/webplugininfo.h" | |
71 | 71 |
72 #if defined(OS_WIN) | 72 #if defined(OS_WIN) |
73 #include "content/common/child_process_messages.h" | 73 #include "content/common/child_process_messages.h" |
74 #include "third_party/WebKit/public/platform/win/WebSandboxSupport.h" | 74 #include "third_party/WebKit/public/platform/win/WebSandboxSupport.h" |
75 #endif | 75 #endif |
76 | 76 |
77 #if defined(OS_MACOSX) | 77 #if defined(OS_MACOSX) |
78 #include "content/common/mac/font_descriptor.h" | 78 #include "content/common/mac/font_descriptor.h" |
79 #include "content/common/mac/font_loader.h" | 79 #include "content/common/mac/font_loader.h" |
80 #include "third_party/WebKit/public/platform/mac/WebSandboxSupport.h" | 80 #include "third_party/WebKit/public/platform/mac/WebSandboxSupport.h" |
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
901 if (accessor) | 901 if (accessor) |
902 return accessor; | 902 return accessor; |
903 | 903 |
904 return new RendererWebMIDIAccessorImpl(client); | 904 return new RendererWebMIDIAccessorImpl(client); |
905 } | 905 } |
906 | 906 |
907 void RendererWebKitPlatformSupportImpl::getPluginList( | 907 void RendererWebKitPlatformSupportImpl::getPluginList( |
908 bool refresh, | 908 bool refresh, |
909 WebKit::WebPluginListBuilder* builder) { | 909 WebKit::WebPluginListBuilder* builder) { |
910 #if defined(ENABLE_PLUGINS) | 910 #if defined(ENABLE_PLUGINS) |
911 std::vector<webkit::WebPluginInfo> plugins; | 911 std::vector<WebPluginInfo> plugins; |
912 if (!plugin_refresh_allowed_) | 912 if (!plugin_refresh_allowed_) |
913 refresh = false; | 913 refresh = false; |
914 RenderThread::Get()->Send( | 914 RenderThread::Get()->Send( |
915 new ViewHostMsg_GetPlugins(refresh, &plugins)); | 915 new ViewHostMsg_GetPlugins(refresh, &plugins)); |
916 for (size_t i = 0; i < plugins.size(); ++i) { | 916 for (size_t i = 0; i < plugins.size(); ++i) { |
917 const webkit::WebPluginInfo& plugin = plugins[i]; | 917 const WebPluginInfo& plugin = plugins[i]; |
918 | 918 |
919 builder->addPlugin( | 919 builder->addPlugin( |
920 plugin.name, plugin.desc, | 920 plugin.name, plugin.desc, |
921 plugin.path.BaseName().AsUTF16Unsafe()); | 921 plugin.path.BaseName().AsUTF16Unsafe()); |
922 | 922 |
923 for (size_t j = 0; j < plugin.mime_types.size(); ++j) { | 923 for (size_t j = 0; j < plugin.mime_types.size(); ++j) { |
924 const webkit::WebPluginMimeType& mime_type = plugin.mime_types[j]; | 924 const WebPluginMimeType& mime_type = plugin.mime_types[j]; |
925 | 925 |
926 builder->addMediaTypeToLastPlugin( | 926 builder->addMediaTypeToLastPlugin( |
927 WebString::fromUTF8(mime_type.mime_type), mime_type.description); | 927 WebString::fromUTF8(mime_type.mime_type), mime_type.description); |
928 | 928 |
929 for (size_t k = 0; k < mime_type.file_extensions.size(); ++k) { | 929 for (size_t k = 0; k < mime_type.file_extensions.size(); ++k) { |
930 builder->addFileExtensionToLastMediaType( | 930 builder->addFileExtensionToLastMediaType( |
931 WebString::fromUTF8(mime_type.file_extensions[k])); | 931 WebString::fromUTF8(mime_type.file_extensions[k])); |
932 } | 932 } |
933 } | 933 } |
934 } | 934 } |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1148 RenderThread::Get()->Send( | 1148 RenderThread::Get()->Send( |
1149 new ViewHostMsg_Vibrate(base::checked_numeric_cast<int64>(milliseconds))); | 1149 new ViewHostMsg_Vibrate(base::checked_numeric_cast<int64>(milliseconds))); |
1150 } | 1150 } |
1151 | 1151 |
1152 void RendererWebKitPlatformSupportImpl::cancelVibration() { | 1152 void RendererWebKitPlatformSupportImpl::cancelVibration() { |
1153 RenderThread::Get()->Send(new ViewHostMsg_CancelVibration()); | 1153 RenderThread::Get()->Send(new ViewHostMsg_CancelVibration()); |
1154 } | 1154 } |
1155 #endif // defined(OS_ANDROID) | 1155 #endif // defined(OS_ANDROID) |
1156 | 1156 |
1157 } // namespace content | 1157 } // namespace content |
OLD | NEW |