Chromium Code Reviews| 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/public/test/layouttest_support.h" | 5 #include "content/public/test/layouttest_support.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "cc/blink/web_layer_impl.h" | 9 #include "cc/blink/web_layer_impl.h" |
| 10 #include "content/browser/renderer_host/render_widget_host_impl.h" | 10 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 11 #include "content/child/bluetooth/web_bluetooth_impl.h" | 11 #include "content/child/bluetooth/web_bluetooth_impl.h" |
| 12 #include "content/child/geofencing/web_geofencing_provider_impl.h" | |
| 12 #include "content/common/gpu/image_transport_surface.h" | 13 #include "content/common/gpu/image_transport_surface.h" |
| 13 #include "content/public/common/page_state.h" | 14 #include "content/public/common/page_state.h" |
| 14 #include "content/public/renderer/renderer_gamepad_provider.h" | 15 #include "content/public/renderer/renderer_gamepad_provider.h" |
| 15 #include "content/renderer/fetchers/manifest_fetcher.h" | 16 #include "content/renderer/fetchers/manifest_fetcher.h" |
| 16 #include "content/renderer/history_entry.h" | 17 #include "content/renderer/history_entry.h" |
| 17 #include "content/renderer/history_serialization.h" | 18 #include "content/renderer/history_serialization.h" |
| 18 #include "content/renderer/render_frame_impl.h" | 19 #include "content/renderer/render_frame_impl.h" |
| 19 #include "content/renderer/render_thread_impl.h" | 20 #include "content/renderer/render_thread_impl.h" |
| 20 #include "content/renderer/render_view_impl.h" | 21 #include "content/renderer/render_view_impl.h" |
| 21 #include "content/renderer/renderer_blink_platform_impl.h" | 22 #include "content/renderer/renderer_blink_platform_impl.h" |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 311 SetDeviceColorProfileForTesting(color_profile); | 312 SetDeviceColorProfileForTesting(color_profile); |
| 312 } | 313 } |
| 313 | 314 |
| 314 void SetBluetoothMockDataSetForTesting(const std::string& name) { | 315 void SetBluetoothMockDataSetForTesting(const std::string& name) { |
| 315 RenderThreadImpl::current() | 316 RenderThreadImpl::current() |
| 316 ->blink_platform_impl() | 317 ->blink_platform_impl() |
| 317 ->BluetoothImplForTesting() | 318 ->BluetoothImplForTesting() |
| 318 ->SetBluetoothMockDataSetForTesting(name); | 319 ->SetBluetoothMockDataSetForTesting(name); |
| 319 } | 320 } |
| 320 | 321 |
| 322 void SetGeofencingMockProvider(bool service_available) { | |
| 323 static_cast<WebGeofencingProviderImpl*>( | |
| 324 RenderThreadImpl::current()->blink_platform_impl()->geofencingProvider()) | |
| 325 ->SetMockProvider(service_available); | |
|
pfeldman
2014/12/10 08:59:52
wrong indentation.
Marijn Kruisselbrink
2014/12/10 18:13:37
this was the indentation clang-format preferred, s
| |
| 326 } | |
| 327 | |
| 328 void ClearGeofencingMockProvider() { | |
| 329 static_cast<WebGeofencingProviderImpl*>( | |
| 330 RenderThreadImpl::current()->blink_platform_impl()->geofencingProvider()) | |
| 331 ->ClearMockProvider(); | |
| 332 } | |
| 333 | |
| 334 void SetGeofencingMockPosition(double latitude, double longitude) { | |
| 335 static_cast<WebGeofencingProviderImpl*>( | |
| 336 RenderThreadImpl::current()->blink_platform_impl()->geofencingProvider()) | |
| 337 ->SetMockPosition(latitude, longitude); | |
| 338 } | |
| 339 | |
| 321 void UseSynchronousResizeMode(RenderView* render_view, bool enable) { | 340 void UseSynchronousResizeMode(RenderView* render_view, bool enable) { |
| 322 static_cast<RenderViewImpl*>(render_view)-> | 341 static_cast<RenderViewImpl*>(render_view)-> |
| 323 UseSynchronousResizeModeForTesting(enable); | 342 UseSynchronousResizeModeForTesting(enable); |
| 324 } | 343 } |
| 325 | 344 |
| 326 void EnableAutoResizeMode(RenderView* render_view, | 345 void EnableAutoResizeMode(RenderView* render_view, |
| 327 const WebSize& min_size, | 346 const WebSize& min_size, |
| 328 const WebSize& max_size) { | 347 const WebSize& max_size) { |
| 329 static_cast<RenderViewImpl*>(render_view)-> | 348 static_cast<RenderViewImpl*>(render_view)-> |
| 330 EnableAutoResizeForTesting(min_size, max_size); | 349 EnableAutoResizeForTesting(min_size, max_size); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 395 } | 414 } |
| 396 result.append("===============================================\n"); | 415 result.append("===============================================\n"); |
| 397 return result; | 416 return result; |
| 398 } | 417 } |
| 399 | 418 |
| 400 blink::WebLayer* InstantiateWebLayer(scoped_refptr<cc::TextureLayer> layer) { | 419 blink::WebLayer* InstantiateWebLayer(scoped_refptr<cc::TextureLayer> layer) { |
| 401 return new cc_blink::WebLayerImpl(layer); | 420 return new cc_blink::WebLayerImpl(layer); |
| 402 } | 421 } |
| 403 | 422 |
| 404 } // namespace content | 423 } // namespace content |
| OLD | NEW |