| 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_blink_platform_impl.h" | 5 #include "content/renderer/renderer_blink_platform_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/logging.h" | 10 #include "base/logging.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "content/child/webfileutilities_impl.h" | 28 #include "content/child/webfileutilities_impl.h" |
| 29 #include "content/child/webmessageportchannel_impl.h" | 29 #include "content/child/webmessageportchannel_impl.h" |
| 30 #include "content/common/file_utilities_messages.h" | 30 #include "content/common/file_utilities_messages.h" |
| 31 #include "content/common/gpu/client/context_provider_command_buffer.h" | 31 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 32 #include "content/common/gpu/client/gpu_channel_host.h" | 32 #include "content/common/gpu/client/gpu_channel_host.h" |
| 33 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 33 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
| 34 #include "content/common/gpu/gpu_process_launch_causes.h" | 34 #include "content/common/gpu/gpu_process_launch_causes.h" |
| 35 #include "content/common/mime_registry_messages.h" | 35 #include "content/common/mime_registry_messages.h" |
| 36 #include "content/common/view_messages.h" | 36 #include "content/common/view_messages.h" |
| 37 #include "content/public/common/content_switches.h" | 37 #include "content/public/common/content_switches.h" |
| 38 #include "content/public/common/service_registry.h" | |
| 39 #include "content/public/common/webplugininfo.h" | 38 #include "content/public/common/webplugininfo.h" |
| 40 #include "content/public/renderer/content_renderer_client.h" | 39 #include "content/public/renderer/content_renderer_client.h" |
| 41 #include "content/renderer/battery_status/battery_status_dispatcher.h" | 40 #include "content/renderer/battery_status/battery_status_dispatcher.h" |
| 42 #include "content/renderer/device_sensors/device_light_event_pump.h" | 41 #include "content/renderer/device_sensors/device_light_event_pump.h" |
| 43 #include "content/renderer/device_sensors/device_motion_event_pump.h" | 42 #include "content/renderer/device_sensors/device_motion_event_pump.h" |
| 44 #include "content/renderer/device_sensors/device_orientation_event_pump.h" | 43 #include "content/renderer/device_sensors/device_orientation_event_pump.h" |
| 45 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" | 44 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" |
| 46 #include "content/renderer/gamepad_shared_memory_reader.h" | 45 #include "content/renderer/gamepad_shared_memory_reader.h" |
| 47 #include "content/renderer/media/audio_decoder.h" | 46 #include "content/renderer/media/audio_decoder.h" |
| 48 #include "content/renderer/media/renderer_webaudiodevice_impl.h" | 47 #include "content/renderer/media/renderer_webaudiodevice_impl.h" |
| (...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1048 | 1047 |
| 1049 // static | 1048 // static |
| 1050 void RendererBlinkPlatformImpl::SetMockDeviceOrientationDataForTesting( | 1049 void RendererBlinkPlatformImpl::SetMockDeviceOrientationDataForTesting( |
| 1051 const blink::WebDeviceOrientationData& data) { | 1050 const blink::WebDeviceOrientationData& data) { |
| 1052 g_test_device_orientation_data.Get() = data; | 1051 g_test_device_orientation_data.Get() = data; |
| 1053 } | 1052 } |
| 1054 | 1053 |
| 1055 //------------------------------------------------------------------------------ | 1054 //------------------------------------------------------------------------------ |
| 1056 | 1055 |
| 1057 void RendererBlinkPlatformImpl::vibrate(unsigned int milliseconds) { | 1056 void RendererBlinkPlatformImpl::vibrate(unsigned int milliseconds) { |
| 1058 GetConnectedVibrationManagerService()->Vibrate( | 1057 RenderThread::Get()->Send( |
| 1059 base::checked_cast<int64>(milliseconds)); | 1058 new ViewHostMsg_Vibrate(base::checked_cast<int64>(milliseconds))); |
| 1060 } | 1059 } |
| 1061 | 1060 |
| 1062 void RendererBlinkPlatformImpl::cancelVibration() { | 1061 void RendererBlinkPlatformImpl::cancelVibration() { |
| 1063 GetConnectedVibrationManagerService()->Cancel(); | 1062 RenderThread::Get()->Send(new ViewHostMsg_CancelVibration()); |
| 1064 } | |
| 1065 | |
| 1066 device::VibrationManagerPtr& | |
| 1067 RendererBlinkPlatformImpl::GetConnectedVibrationManagerService() { | |
| 1068 if (!vibration_manager_) { | |
| 1069 RenderThread::Get()->GetServiceRegistry() | |
| 1070 ->ConnectToRemoteService(&vibration_manager_); | |
| 1071 } | |
| 1072 return vibration_manager_; | |
| 1073 } | 1063 } |
| 1074 | 1064 |
| 1075 //------------------------------------------------------------------------------ | 1065 //------------------------------------------------------------------------------ |
| 1076 | 1066 |
| 1077 // static | 1067 // static |
| 1078 PlatformEventObserverBase* | 1068 PlatformEventObserverBase* |
| 1079 RendererBlinkPlatformImpl::CreatePlatformEventObserverFromType( | 1069 RendererBlinkPlatformImpl::CreatePlatformEventObserverFromType( |
| 1080 blink::WebPlatformEventType type) { | 1070 blink::WebPlatformEventType type) { |
| 1081 RenderThread* thread = RenderThreadImpl::current(); | 1071 RenderThread* thread = RenderThreadImpl::current(); |
| 1082 | 1072 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1221 //------------------------------------------------------------------------------ | 1211 //------------------------------------------------------------------------------ |
| 1222 | 1212 |
| 1223 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( | 1213 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( |
| 1224 const blink::WebBatteryStatus& status) { | 1214 const blink::WebBatteryStatus& status) { |
| 1225 if (!g_test_battery_status_listener) | 1215 if (!g_test_battery_status_listener) |
| 1226 return; | 1216 return; |
| 1227 g_test_battery_status_listener->updateBatteryStatus(status); | 1217 g_test_battery_status_listener->updateBatteryStatus(status); |
| 1228 } | 1218 } |
| 1229 | 1219 |
| 1230 } // namespace content | 1220 } // namespace content |
| OLD | NEW |