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" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
50 #include "media/filters/stream_parser_factory.h" | 50 #include "media/filters/stream_parser_factory.h" |
51 #include "net/base/mime_util.h" | 51 #include "net/base/mime_util.h" |
52 #include "net/base/net_util.h" | 52 #include "net/base/net_util.h" |
53 #include "third_party/WebKit/public/platform/WebBlobRegistry.h" | 53 #include "third_party/WebKit/public/platform/WebBlobRegistry.h" |
54 #include "third_party/WebKit/public/platform/WebDeviceMotionListener.h" | 54 #include "third_party/WebKit/public/platform/WebDeviceMotionListener.h" |
55 #include "third_party/WebKit/public/platform/WebFileInfo.h" | 55 #include "third_party/WebKit/public/platform/WebFileInfo.h" |
56 #include "third_party/WebKit/public/platform/WebGamepads.h" | 56 #include "third_party/WebKit/public/platform/WebGamepads.h" |
57 #include "third_party/WebKit/public/platform/WebHyphenator.h" | 57 #include "third_party/WebKit/public/platform/WebHyphenator.h" |
58 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" | 58 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" |
59 #include "third_party/WebKit/public/platform/WebMediaStreamCenterClient.h" | 59 #include "third_party/WebKit/public/platform/WebMediaStreamCenterClient.h" |
60 #include "third_party/WebKit/public/platform/WebPluginListBuilder.h" | |
60 #include "third_party/WebKit/public/platform/WebURL.h" | 61 #include "third_party/WebKit/public/platform/WebURL.h" |
61 #include "third_party/WebKit/public/platform/WebVector.h" | 62 #include "third_party/WebKit/public/platform/WebVector.h" |
62 #include "third_party/WebKit/public/web/WebFrame.h" | 63 #include "third_party/WebKit/public/web/WebFrame.h" |
63 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 64 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
64 #include "url/gurl.h" | 65 #include "url/gurl.h" |
65 #include "webkit/common/gpu/webgraphicscontext3d_provider_impl.h" | 66 #include "webkit/common/gpu/webgraphicscontext3d_provider_impl.h" |
66 #include "webkit/glue/simple_webmimeregistry_impl.h" | 67 #include "webkit/glue/simple_webmimeregistry_impl.h" |
67 #include "webkit/glue/webfileutilities_impl.h" | 68 #include "webkit/glue/webfileutilities_impl.h" |
68 #include "webkit/glue/webkit_glue.h" | 69 #include "webkit/glue/webkit_glue.h" |
70 #include "webkit/plugins/webplugininfo.h" | |
69 | 71 |
70 #if defined(OS_WIN) | 72 #if defined(OS_WIN) |
71 #include "content/common/child_process_messages.h" | 73 #include "content/common/child_process_messages.h" |
72 #include "third_party/WebKit/public/platform/win/WebSandboxSupport.h" | 74 #include "third_party/WebKit/public/platform/win/WebSandboxSupport.h" |
73 #endif | 75 #endif |
74 | 76 |
75 #if defined(OS_MACOSX) | 77 #if defined(OS_MACOSX) |
76 #include "content/common/mac/font_descriptor.h" | 78 #include "content/common/mac/font_descriptor.h" |
77 #include "content/common/mac/font_loader.h" | 79 #include "content/common/mac/font_loader.h" |
78 #include "third_party/WebKit/public/platform/mac/WebSandboxSupport.h" | 80 #include "third_party/WebKit/public/platform/mac/WebSandboxSupport.h" |
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
895 RendererWebKitPlatformSupportImpl::createMIDIAccessor( | 897 RendererWebKitPlatformSupportImpl::createMIDIAccessor( |
896 WebKit::WebMIDIAccessorClient* client) { | 898 WebKit::WebMIDIAccessorClient* client) { |
897 WebKit::WebMIDIAccessor* accessor = | 899 WebKit::WebMIDIAccessor* accessor = |
898 GetContentClient()->renderer()->OverrideCreateMIDIAccessor(client); | 900 GetContentClient()->renderer()->OverrideCreateMIDIAccessor(client); |
899 if (accessor) | 901 if (accessor) |
900 return accessor; | 902 return accessor; |
901 | 903 |
902 return new RendererWebMIDIAccessorImpl(client); | 904 return new RendererWebMIDIAccessorImpl(client); |
903 } | 905 } |
904 | 906 |
907 void RendererWebKitPlatformSupportImpl::getPluginList( | |
908 bool refresh, | |
909 WebKit::WebPluginListBuilder* builder) { | |
910 #if defined(ENABLE_PLUGINS) | |
911 std::vector<webkit::WebPluginInfo> plugins; | |
912 if (!plugin_refresh_allowed_) | |
913 refresh = false; | |
914 RenderThread::Get()->Send( | |
915 new ViewHostMsg_GetPlugins(refresh, &plugins)); | |
916 for (size_t i = 0; i < plugins.size(); ++i) { | |
917 const webkit::WebPluginInfo& plugin = plugins[i]; | |
918 | |
919 builder->addPlugin( | |
920 plugin.name, plugin.desc, | |
921 plugin.path.BaseName().AsUTF16Unsafe()); | |
922 | |
923 for (size_t j = 0; j < plugin.mime_types.size(); ++j) { | |
924 const webkit::WebPluginMimeType& mime_type = plugin.mime_types[j]; | |
925 | |
926 builder->addMediaTypeToLastPlugin( | |
927 WebString::fromUTF8(mime_type.mime_type), mime_type.description); | |
928 | |
929 for (size_t k = 0; k < mime_type.file_extensions.size(); ++k) { | |
930 builder->addFileExtensionToLastMediaType( | |
931 UTF8ToUTF16(mime_type.file_extensions[k])); | |
jamesr
2013/07/20 00:26:01
WebString::fromUTF8() here is better since it won'
jam
2013/07/20 00:30:39
Done.
| |
932 } | |
933 } | |
934 } | |
935 #endif | |
936 } | |
937 | |
905 //------------------------------------------------------------------------------ | 938 //------------------------------------------------------------------------------ |
906 | 939 |
907 WebKit::WebString | 940 WebKit::WebString |
908 RendererWebKitPlatformSupportImpl::signedPublicKeyAndChallengeString( | 941 RendererWebKitPlatformSupportImpl::signedPublicKeyAndChallengeString( |
909 unsigned key_size_index, | 942 unsigned key_size_index, |
910 const WebKit::WebString& challenge, | 943 const WebKit::WebString& challenge, |
911 const WebKit::WebURL& url) { | 944 const WebKit::WebURL& url) { |
912 std::string signed_public_key; | 945 std::string signed_public_key; |
913 RenderThread::Get()->Send(new ViewHostMsg_Keygen( | 946 RenderThread::Get()->Send(new ViewHostMsg_Keygen( |
914 static_cast<uint32>(key_size_index), | 947 static_cast<uint32>(key_size_index), |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
948 gamepads = g_test_gamepads.Get(); | 981 gamepads = g_test_gamepads.Get(); |
949 return; | 982 return; |
950 } | 983 } |
951 } | 984 } |
952 | 985 |
953 WebKit::WebString RendererWebKitPlatformSupportImpl::userAgent( | 986 WebKit::WebString RendererWebKitPlatformSupportImpl::userAgent( |
954 const WebKit::WebURL& url) { | 987 const WebKit::WebURL& url) { |
955 return WebKitPlatformSupportImpl::userAgent(url); | 988 return WebKitPlatformSupportImpl::userAgent(url); |
956 } | 989 } |
957 | 990 |
958 void RendererWebKitPlatformSupportImpl::GetPlugins( | |
959 bool refresh, std::vector<webkit::WebPluginInfo>* plugins) { | |
960 #if defined(ENABLE_PLUGINS) | |
961 if (!plugin_refresh_allowed_) | |
962 refresh = false; | |
963 RenderThread::Get()->Send( | |
964 new ViewHostMsg_GetPlugins(refresh, plugins)); | |
965 #endif | |
966 } | |
967 | |
968 //------------------------------------------------------------------------------ | 991 //------------------------------------------------------------------------------ |
969 | 992 |
970 WebRTCPeerConnectionHandler* | 993 WebRTCPeerConnectionHandler* |
971 RendererWebKitPlatformSupportImpl::createRTCPeerConnectionHandler( | 994 RendererWebKitPlatformSupportImpl::createRTCPeerConnectionHandler( |
972 WebRTCPeerConnectionHandlerClient* client) { | 995 WebRTCPeerConnectionHandlerClient* client) { |
973 RenderThreadImpl* render_thread = RenderThreadImpl::current(); | 996 RenderThreadImpl* render_thread = RenderThreadImpl::current(); |
974 DCHECK(render_thread); | 997 DCHECK(render_thread); |
975 if (!render_thread) | 998 if (!render_thread) |
976 return NULL; | 999 return NULL; |
977 | 1000 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1125 RenderThread::Get()->Send( | 1148 RenderThread::Get()->Send( |
1126 new ViewHostMsg_Vibrate(base::checked_numeric_cast<int64>(milliseconds))); | 1149 new ViewHostMsg_Vibrate(base::checked_numeric_cast<int64>(milliseconds))); |
1127 } | 1150 } |
1128 | 1151 |
1129 void RendererWebKitPlatformSupportImpl::cancelVibration() { | 1152 void RendererWebKitPlatformSupportImpl::cancelVibration() { |
1130 RenderThread::Get()->Send(new ViewHostMsg_CancelVibration()); | 1153 RenderThread::Get()->Send(new ViewHostMsg_CancelVibration()); |
1131 } | 1154 } |
1132 #endif // defined(OS_ANDROID) | 1155 #endif // defined(OS_ANDROID) |
1133 | 1156 |
1134 } // namespace content | 1157 } // namespace content |
OLD | NEW |