Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Side by Side Diff: content/renderer/renderer_webkitplatformsupport_impl.cc

Issue 302553007: Call RenderViewImpl::SetScreenOrientationForTesting to make sure that events are not sent when orie… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 g_test_screen_orientation_controller.Get().ResetData();
1084 } 1084 }
1085 1085
1086 // static
1087 void
1088 RendererWebKitPlatformSupportImpl::ResetMockScreenOrientationRenderView() {
1089 if (!(g_test_screen_orientation_controller == 0)) {
Inactive 2014/05/28 12:02:20 nit: useless curly brackets (I don't know if this
ostap 2014/05/28 19:17:05 Done.
1090 g_test_screen_orientation_controller.Get().ResetRenderView();
1091 }
1092 }
1093
1086 //------------------------------------------------------------------------------ 1094 //------------------------------------------------------------------------------
1087 1095
1088 void RendererWebKitPlatformSupportImpl::setDeviceOrientationListener( 1096 void RendererWebKitPlatformSupportImpl::setDeviceOrientationListener(
1089 blink::WebDeviceOrientationListener* listener) { 1097 blink::WebDeviceOrientationListener* listener) {
1090 if (g_test_device_orientation_data == 0) { 1098 if (g_test_device_orientation_data == 0) {
1091 if (!device_orientation_event_pump_) { 1099 if (!device_orientation_event_pump_) {
1092 device_orientation_event_pump_.reset(new DeviceOrientationEventPump); 1100 device_orientation_event_pump_.reset(new DeviceOrientationEventPump);
1093 device_orientation_event_pump_->Attach(RenderThreadImpl::current()); 1101 device_orientation_event_pump_->Attach(RenderThreadImpl::current());
1094 } 1102 }
1095 device_orientation_event_pump_->SetListener(listener); 1103 device_orientation_event_pump_->SetListener(listener);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
1157 if (RenderThreadImpl::current() && 1165 if (RenderThreadImpl::current() &&
1158 RenderThreadImpl::current()->layout_test_mode()) { 1166 RenderThreadImpl::current()->layout_test_mode()) {
1159 g_test_screen_orientation_controller.Get().ResetLock(); 1167 g_test_screen_orientation_controller.Get().ResetLock();
1160 return; 1168 return;
1161 } 1169 }
1162 RenderThread::Get()->Send(new ScreenOrientationHostMsg_Unlock); 1170 RenderThread::Get()->Send(new ScreenOrientationHostMsg_Unlock);
1163 } 1171 }
1164 1172
1165 // static 1173 // static
1166 void RendererWebKitPlatformSupportImpl::SetMockScreenOrientationForTesting( 1174 void RendererWebKitPlatformSupportImpl::SetMockScreenOrientationForTesting(
1175 RenderView* render_view,
1167 blink::WebScreenOrientationType orientation) { 1176 blink::WebScreenOrientationType orientation) {
1168 g_test_screen_orientation_controller.Get() 1177 g_test_screen_orientation_controller.Get()
1169 .UpdateDeviceOrientation(orientation); 1178 .UpdateDeviceOrientation(render_view, orientation);
1170 } 1179 }
1171 1180
1172 //------------------------------------------------------------------------------ 1181 //------------------------------------------------------------------------------
1173 1182
1174 void RendererWebKitPlatformSupportImpl::queryStorageUsageAndQuota( 1183 void RendererWebKitPlatformSupportImpl::queryStorageUsageAndQuota(
1175 const blink::WebURL& storage_partition, 1184 const blink::WebURL& storage_partition,
1176 blink::WebStorageQuotaType type, 1185 blink::WebStorageQuotaType type,
1177 blink::WebStorageQuotaCallbacks callbacks) { 1186 blink::WebStorageQuotaCallbacks callbacks) {
1178 if (!thread_safe_sender_.get() || !quota_message_filter_.get()) 1187 if (!thread_safe_sender_.get() || !quota_message_filter_.get())
1179 return; 1188 return;
(...skipping 10 matching lines...) Expand all
1190 void RendererWebKitPlatformSupportImpl::setBatteryStatusListener( 1199 void RendererWebKitPlatformSupportImpl::setBatteryStatusListener(
1191 blink::WebBatteryStatusListener* listener) { 1200 blink::WebBatteryStatusListener* listener) {
1192 if (!battery_status_dispatcher_) { 1201 if (!battery_status_dispatcher_) {
1193 battery_status_dispatcher_.reset( 1202 battery_status_dispatcher_.reset(
1194 new BatteryStatusDispatcher(RenderThreadImpl::current())); 1203 new BatteryStatusDispatcher(RenderThreadImpl::current()));
1195 } 1204 }
1196 battery_status_dispatcher_->SetListener(listener); 1205 battery_status_dispatcher_->SetListener(listener);
1197 } 1206 }
1198 1207
1199 } // namespace content 1208 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698