| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <unordered_map> | 10 #include <unordered_map> |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 const blink::WebInputEvent& event) { | 492 const blink::WebInputEvent& event) { |
| 493 DCHECK(web_widget_test_proxy_base); | 493 DCHECK(web_widget_test_proxy_base); |
| 494 RenderWidget* render_widget = GetRenderWidget(web_widget_test_proxy_base); | 494 RenderWidget* render_widget = GetRenderWidget(web_widget_test_proxy_base); |
| 495 | 495 |
| 496 blink::WebRect view_rect = render_widget->ViewRect(); | 496 blink::WebRect view_rect = render_widget->ViewRect(); |
| 497 float scale = GetWindowToViewportScale(render_widget); | 497 float scale = GetWindowToViewportScale(render_widget); |
| 498 gfx::Vector2d delta(-view_rect.x, -view_rect.y); | 498 gfx::Vector2d delta(-view_rect.x, -view_rect.y); |
| 499 return ui::TranslateAndScaleWebInputEvent(event, delta, scale); | 499 return ui::TranslateAndScaleWebInputEvent(event, delta, scale); |
| 500 } | 500 } |
| 501 | 501 |
| 502 gfx::ICCProfile GetTestingICCProfile(const std::string& name) { | 502 gfx::ColorSpace GetTestingColorSpace(const std::string& name) { |
| 503 if (name == "genericRGB") { | 503 if (name == "genericRGB") { |
| 504 return gfx::ICCProfileForTestingGenericRGB(); | 504 return gfx::ICCProfileForTestingGenericRGB().GetColorSpace(); |
| 505 } else if (name == "sRGB") { | 505 } else if (name == "sRGB") { |
| 506 return gfx::ICCProfileForTestingSRGB(); | 506 return gfx::ColorSpace::CreateSRGB(); |
| 507 } else if (name == "test" || name == "colorSpin") { | 507 } else if (name == "test" || name == "colorSpin") { |
| 508 return gfx::ICCProfileForTestingColorSpin(); | 508 return gfx::ICCProfileForTestingColorSpin().GetColorSpace(); |
| 509 } else if (name == "adobeRGB") { | 509 } else if (name == "adobeRGB") { |
| 510 return gfx::ICCProfileForTestingAdobeRGB(); | 510 return gfx::ICCProfileForTestingAdobeRGB().GetColorSpace(); |
| 511 } else if (name == "reset") { | 511 } else if (name == "reset") { |
| 512 return gfx::ICCProfileForLayoutTests(); | 512 return gfx::ICCProfileForLayoutTests().GetColorSpace(); |
| 513 } | 513 } |
| 514 return gfx::ICCProfile(); | 514 return gfx::ColorSpace(); |
| 515 } | 515 } |
| 516 | 516 |
| 517 void SetDeviceColorProfile( | 517 void SetDeviceColorSpace(RenderView* render_view, |
| 518 RenderView* render_view, const gfx::ICCProfile& icc_profile) { | 518 const gfx::ColorSpace& color_space) { |
| 519 static_cast<RenderViewImpl*>(render_view)-> | 519 static_cast<RenderViewImpl*>(render_view) |
| 520 SetDeviceColorProfileForTesting(icc_profile); | 520 ->SetDeviceColorSpaceForTesting(color_space); |
| 521 } | 521 } |
| 522 | 522 |
| 523 void SetTestBluetoothScanDuration() { | 523 void SetTestBluetoothScanDuration() { |
| 524 BluetoothDeviceChooserController::SetTestScanDurationForTesting(); | 524 BluetoothDeviceChooserController::SetTestScanDurationForTesting(); |
| 525 } | 525 } |
| 526 | 526 |
| 527 void UseSynchronousResizeMode(RenderView* render_view, bool enable) { | 527 void UseSynchronousResizeMode(RenderView* render_view, bool enable) { |
| 528 static_cast<RenderViewImpl*>(render_view)-> | 528 static_cast<RenderViewImpl*>(render_view)-> |
| 529 UseSynchronousResizeModeForTesting(enable); | 529 UseSynchronousResizeModeForTesting(enable); |
| 530 } | 530 } |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 } | 611 } |
| 612 } | 612 } |
| 613 | 613 |
| 614 bool IsNavigationInitiatedByRenderer(const blink::WebURLRequest& request) { | 614 bool IsNavigationInitiatedByRenderer(const blink::WebURLRequest& request) { |
| 615 RequestExtraData* extra_data = | 615 RequestExtraData* extra_data = |
| 616 static_cast<RequestExtraData*>(request.GetExtraData()); | 616 static_cast<RequestExtraData*>(request.GetExtraData()); |
| 617 return extra_data && extra_data->navigation_initiated_by_renderer(); | 617 return extra_data && extra_data->navigation_initiated_by_renderer(); |
| 618 } | 618 } |
| 619 | 619 |
| 620 } // namespace content | 620 } // namespace content |
| OLD | NEW |