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 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1073 | 1073 |
1074 // static | 1074 // static |
1075 void RendererWebKitPlatformSupportImpl::SetMockDeviceMotionDataForTesting( | 1075 void RendererWebKitPlatformSupportImpl::SetMockDeviceMotionDataForTesting( |
1076 const blink::WebDeviceMotionData& data) { | 1076 const blink::WebDeviceMotionData& data) { |
1077 g_test_device_motion_data.Get() = data; | 1077 g_test_device_motion_data.Get() = data; |
1078 } | 1078 } |
1079 | 1079 |
1080 // static | 1080 // static |
1081 void RendererWebKitPlatformSupportImpl::ResetMockScreenOrientationForTesting() | 1081 void RendererWebKitPlatformSupportImpl::ResetMockScreenOrientationForTesting() |
1082 { | 1082 { |
1083 g_test_screen_orientation_controller.Get().ResetData(); | 1083 if (!(g_test_screen_orientation_controller == 0)) { |
mlamouri (slow - plz ping)
2014/05/30 09:07:57
Why do you need a null check that you didn't need
ostap
2014/05/30 15:21:43
Done.
ostap
2014/06/10 18:02:52
Actually, now Reset is always called on every layo
| |
1084 g_test_screen_orientation_controller.Get().ResetData(); | |
1085 g_test_screen_orientation_controller.Get().ResetRenderView(); | |
mlamouri (slow - plz ping)
2014/05/30 09:07:57
Is there a reason why ResetRenderView() should be
ostap
2014/05/30 15:21:43
Done.
| |
1086 } | |
1084 } | 1087 } |
1085 | 1088 |
1086 //------------------------------------------------------------------------------ | 1089 //------------------------------------------------------------------------------ |
1087 | 1090 |
1088 void RendererWebKitPlatformSupportImpl::setDeviceOrientationListener( | 1091 void RendererWebKitPlatformSupportImpl::setDeviceOrientationListener( |
1089 blink::WebDeviceOrientationListener* listener) { | 1092 blink::WebDeviceOrientationListener* listener) { |
1090 if (g_test_device_orientation_data == 0) { | 1093 if (g_test_device_orientation_data == 0) { |
1091 if (!device_orientation_event_pump_) { | 1094 if (!device_orientation_event_pump_) { |
1092 device_orientation_event_pump_.reset(new DeviceOrientationEventPump); | 1095 device_orientation_event_pump_.reset(new DeviceOrientationEventPump); |
1093 device_orientation_event_pump_->Attach(RenderThreadImpl::current()); | 1096 device_orientation_event_pump_->Attach(RenderThreadImpl::current()); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1157 if (RenderThreadImpl::current() && | 1160 if (RenderThreadImpl::current() && |
1158 RenderThreadImpl::current()->layout_test_mode()) { | 1161 RenderThreadImpl::current()->layout_test_mode()) { |
1159 g_test_screen_orientation_controller.Get().ResetLock(); | 1162 g_test_screen_orientation_controller.Get().ResetLock(); |
1160 return; | 1163 return; |
1161 } | 1164 } |
1162 RenderThread::Get()->Send(new ScreenOrientationHostMsg_Unlock); | 1165 RenderThread::Get()->Send(new ScreenOrientationHostMsg_Unlock); |
1163 } | 1166 } |
1164 | 1167 |
1165 // static | 1168 // static |
1166 void RendererWebKitPlatformSupportImpl::SetMockScreenOrientationForTesting( | 1169 void RendererWebKitPlatformSupportImpl::SetMockScreenOrientationForTesting( |
1170 RenderView* render_view, | |
1167 blink::WebScreenOrientationType orientation) { | 1171 blink::WebScreenOrientationType orientation) { |
1168 g_test_screen_orientation_controller.Get() | 1172 g_test_screen_orientation_controller.Get() |
1169 .UpdateDeviceOrientation(orientation); | 1173 .UpdateDeviceOrientation(render_view, orientation); |
1170 } | 1174 } |
1171 | 1175 |
1172 //------------------------------------------------------------------------------ | 1176 //------------------------------------------------------------------------------ |
1173 | 1177 |
1174 void RendererWebKitPlatformSupportImpl::queryStorageUsageAndQuota( | 1178 void RendererWebKitPlatformSupportImpl::queryStorageUsageAndQuota( |
1175 const blink::WebURL& storage_partition, | 1179 const blink::WebURL& storage_partition, |
1176 blink::WebStorageQuotaType type, | 1180 blink::WebStorageQuotaType type, |
1177 blink::WebStorageQuotaCallbacks callbacks) { | 1181 blink::WebStorageQuotaCallbacks callbacks) { |
1178 if (!thread_safe_sender_.get() || !quota_message_filter_.get()) | 1182 if (!thread_safe_sender_.get() || !quota_message_filter_.get()) |
1179 return; | 1183 return; |
(...skipping 10 matching lines...) Expand all Loading... | |
1190 void RendererWebKitPlatformSupportImpl::setBatteryStatusListener( | 1194 void RendererWebKitPlatformSupportImpl::setBatteryStatusListener( |
1191 blink::WebBatteryStatusListener* listener) { | 1195 blink::WebBatteryStatusListener* listener) { |
1192 if (!battery_status_dispatcher_) { | 1196 if (!battery_status_dispatcher_) { |
1193 battery_status_dispatcher_.reset( | 1197 battery_status_dispatcher_.reset( |
1194 new BatteryStatusDispatcher(RenderThreadImpl::current())); | 1198 new BatteryStatusDispatcher(RenderThreadImpl::current())); |
1195 } | 1199 } |
1196 battery_status_dispatcher_->SetListener(listener); | 1200 battery_status_dispatcher_->SetListener(listener); |
1197 } | 1201 } |
1198 | 1202 |
1199 } // namespace content | 1203 } // namespace content |
OLD | NEW |