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 #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/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
11 #include "base/shared_memory.h" | 11 #include "base/shared_memory.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
13 #include "content/common/database_util.h" | 13 #include "content/common/database_util.h" |
14 #include "content/common/file_system/webfilesystem_impl.h" | 14 #include "content/common/file_system/webfilesystem_impl.h" |
15 #include "content/common/file_utilities_messages.h" | 15 #include "content/common/file_utilities_messages.h" |
16 #include "content/common/mime_registry_messages.h" | 16 #include "content/common/mime_registry_messages.h" |
17 #include "content/common/npobject_util.h" | 17 #include "content/common/npobject_util.h" |
18 #include "content/common/view_messages.h" | 18 #include "content/common/view_messages.h" |
19 #include "content/common/webblobregistry_impl.h" | 19 #include "content/common/webblobregistry_impl.h" |
20 #include "content/common/webmessageportchannel_impl.h" | 20 #include "content/common/webmessageportchannel_impl.h" |
21 #include "content/public/common/content_switches.h" | 21 #include "content/public/common/content_switches.h" |
22 #include "content/public/renderer/content_renderer_client.h" | 22 #include "content/public/renderer/content_renderer_client.h" |
| 23 #include "content/renderer/gamepad_shared_memory_reader.h" |
23 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" | 24 #include "content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.h" |
24 #include "content/renderer/media/audio_device.h" | 25 #include "content/renderer/media/audio_device.h" |
25 #include "content/renderer/media/audio_hardware.h" | 26 #include "content/renderer/media/audio_hardware.h" |
26 #include "content/renderer/render_thread_impl.h" | 27 #include "content/renderer/render_thread_impl.h" |
27 #include "content/renderer/renderer_clipboard_client.h" | 28 #include "content/renderer/renderer_clipboard_client.h" |
28 #include "content/renderer/renderer_webaudiodevice_impl.h" | 29 #include "content/renderer/renderer_webaudiodevice_impl.h" |
29 #include "content/renderer/renderer_webidbfactory_impl.h" | 30 #include "content/renderer/renderer_webidbfactory_impl.h" |
30 #include "content/renderer/renderer_webstoragenamespace_impl.h" | 31 #include "content/renderer/renderer_webstoragenamespace_impl.h" |
31 #include "content/renderer/websharedworkerrepository_impl.h" | 32 #include "content/renderer/websharedworkerrepository_impl.h" |
32 #include "googleurl/src/gurl.h" | 33 #include "googleurl/src/gurl.h" |
33 #include "ipc/ipc_sync_message_filter.h" | 34 #include "ipc/ipc_sync_message_filter.h" |
34 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBlobRegistry.h" | 35 #include "third_party/WebKit/Source/WebKit/chromium/public/WebBlobRegistry.h" |
35 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 36 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebGamepads.h" |
36 #include "third_party/WebKit/Source/WebKit/chromium/public/WebGraphicsContext3D.
h" | 38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebGraphicsContext3D.
h" |
37 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBFactory.h" | 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBFactory.h" |
38 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h" | 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKey.h" |
39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h" | 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBKeyPath.h" |
40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSerializedScriptVa
lue.h" | 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSerializedScriptVa
lue.h" |
41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispat
cher.h" | 43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispat
cher.h" |
42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" | 44 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" |
43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h" | 45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h" |
44 #include "webkit/glue/simple_webmimeregistry_impl.h" | 46 #include "webkit/glue/simple_webmimeregistry_impl.h" |
45 #include "webkit/glue/webclipboard_impl.h" | 47 #include "webkit/glue/webclipboard_impl.h" |
(...skipping 23 matching lines...) Expand all Loading... |
69 #endif | 71 #endif |
70 | 72 |
71 #if defined(OS_POSIX) | 73 #if defined(OS_POSIX) |
72 #include "base/file_descriptor_posix.h" | 74 #include "base/file_descriptor_posix.h" |
73 #endif | 75 #endif |
74 | 76 |
75 using WebKit::WebAudioDevice; | 77 using WebKit::WebAudioDevice; |
76 using WebKit::WebBlobRegistry; | 78 using WebKit::WebBlobRegistry; |
77 using WebKit::WebFileSystem; | 79 using WebKit::WebFileSystem; |
78 using WebKit::WebFrame; | 80 using WebKit::WebFrame; |
| 81 using WebKit::WebGamepads; |
79 using WebKit::WebIDBFactory; | 82 using WebKit::WebIDBFactory; |
80 using WebKit::WebIDBKey; | 83 using WebKit::WebIDBKey; |
81 using WebKit::WebIDBKeyPath; | 84 using WebKit::WebIDBKeyPath; |
82 using WebKit::WebKitPlatformSupport; | 85 using WebKit::WebKitPlatformSupport; |
83 using WebKit::WebSerializedScriptValue; | 86 using WebKit::WebSerializedScriptValue; |
84 using WebKit::WebStorageArea; | 87 using WebKit::WebStorageArea; |
85 using WebKit::WebStorageEventDispatcher; | 88 using WebKit::WebStorageEventDispatcher; |
86 using WebKit::WebStorageNamespace; | 89 using WebKit::WebStorageNamespace; |
87 using WebKit::WebString; | 90 using WebKit::WebString; |
88 using WebKit::WebURL; | 91 using WebKit::WebURL; |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 //------------------------------------------------------------------------------ | 615 //------------------------------------------------------------------------------ |
613 | 616 |
614 WebBlobRegistry* RendererWebKitPlatformSupportImpl::blobRegistry() { | 617 WebBlobRegistry* RendererWebKitPlatformSupportImpl::blobRegistry() { |
615 // ChildThread::current can be NULL when running some tests. | 618 // ChildThread::current can be NULL when running some tests. |
616 if (!blob_registry_.get() && ChildThread::current()) { | 619 if (!blob_registry_.get() && ChildThread::current()) { |
617 blob_registry_.reset(new WebBlobRegistryImpl(ChildThread::current())); | 620 blob_registry_.reset(new WebBlobRegistryImpl(ChildThread::current())); |
618 } | 621 } |
619 return blob_registry_.get(); | 622 return blob_registry_.get(); |
620 } | 623 } |
621 | 624 |
| 625 //------------------------------------------------------------------------------ |
| 626 |
| 627 void RendererWebKitPlatformSupportImpl::sampleGamepads(WebGamepads& gamepads) { |
| 628 if (!gamepad_shared_memory_reader_.get()) |
| 629 gamepad_shared_memory_reader_.reset(new content::GamepadSharedMemoryReader); |
| 630 gamepad_shared_memory_reader_->SampleGamepads(gamepads); |
| 631 } |
| 632 |
622 WebKit::WebString RendererWebKitPlatformSupportImpl::userAgent( | 633 WebKit::WebString RendererWebKitPlatformSupportImpl::userAgent( |
623 const WebKit::WebURL& url) { | 634 const WebKit::WebURL& url) { |
624 return WebKitPlatformSupportImpl::userAgent(url); | 635 return WebKitPlatformSupportImpl::userAgent(url); |
625 } | 636 } |
626 | 637 |
627 void RendererWebKitPlatformSupportImpl::GetPlugins( | 638 void RendererWebKitPlatformSupportImpl::GetPlugins( |
628 bool refresh, std::vector<webkit::WebPluginInfo>* plugins) { | 639 bool refresh, std::vector<webkit::WebPluginInfo>* plugins) { |
629 if (!RenderThreadImpl::current()->plugin_refresh_allowed()) | 640 if (!RenderThreadImpl::current()->plugin_refresh_allowed()) |
630 refresh = false; | 641 refresh = false; |
631 RenderThreadImpl::current()->Send( | 642 RenderThreadImpl::current()->Send( |
632 new ViewHostMsg_GetPlugins(refresh, plugins)); | 643 new ViewHostMsg_GetPlugins(refresh, plugins)); |
633 } | 644 } |
OLD | NEW |