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

Side by Side Diff: third_party/WebKit/Source/platform/testing/WebLayerTreeViewImplForTesting.cpp

Issue 2237433004: Adds DevTools commands for forced viewport override. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address Dmitry's comments + sync. Created 4 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "platform/testing/WebLayerTreeViewImplForTesting.h" 5 #include "platform/testing/WebLayerTreeViewImplForTesting.h"
6 6
7 #include "base/threading/thread_task_runner_handle.h" 7 #include "base/threading/thread_task_runner_handle.h"
8 #include "cc/animation/animation_host.h" 8 #include "cc/animation/animation_host.h"
9 #include "cc/animation/animation_timeline.h" 9 #include "cc/animation/animation_timeline.h"
10 #include "cc/blink/web_layer_impl.h" 10 #include "cc/blink/web_layer_impl.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 gfx::Size gfxSize(std::max(0, deviceViewportSize.width), std::max(0, deviceV iewportSize.height)); 80 gfx::Size gfxSize(std::max(0, deviceViewportSize.width), std::max(0, deviceV iewportSize.height));
81 m_layerTreeHost->GetLayerTree()->SetViewportSize(gfxSize); 81 m_layerTreeHost->GetLayerTree()->SetViewportSize(gfxSize);
82 } 82 }
83 83
84 void WebLayerTreeViewImplForTesting::setViewportSize(const WebSize& deviceViewpo rtSize) 84 void WebLayerTreeViewImplForTesting::setViewportSize(const WebSize& deviceViewpo rtSize)
85 { 85 {
86 gfx::Size gfxSize(std::max(0, deviceViewportSize.width), std::max(0, deviceV iewportSize.height)); 86 gfx::Size gfxSize(std::max(0, deviceViewportSize.width), std::max(0, deviceV iewportSize.height));
87 m_layerTreeHost->GetLayerTree()->SetViewportSize(gfxSize); 87 m_layerTreeHost->GetLayerTree()->SetViewportSize(gfxSize);
88 } 88 }
89 89
90 WebSize WebLayerTreeViewImplForTesting::getViewportSize() const
91 {
92 return WebSize(
93 m_layerTreeHost->GetLayerTree()->device_viewport_size().width(),
94 m_layerTreeHost->GetLayerTree()->device_viewport_size().height());
95 }
96
90 void WebLayerTreeViewImplForTesting::setDeviceScaleFactor(float deviceScaleFacto r) 97 void WebLayerTreeViewImplForTesting::setDeviceScaleFactor(float deviceScaleFacto r)
91 { 98 {
92 m_layerTreeHost->GetLayerTree()->SetDeviceScaleFactor(deviceScaleFactor); 99 m_layerTreeHost->GetLayerTree()->SetDeviceScaleFactor(deviceScaleFactor);
93 } 100 }
94 101
95 void WebLayerTreeViewImplForTesting::setBackgroundColor(WebColor color) 102 void WebLayerTreeViewImplForTesting::setBackgroundColor(WebColor color)
96 { 103 {
97 m_layerTreeHost->GetLayerTree()->set_background_color(color); 104 m_layerTreeHost->GetLayerTree()->set_background_color(color);
98 } 105 }
99 106
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 { 223 {
217 m_layerTreeHost->GetLayerTree()->SetHaveScrollEventHandlers(haveEentHandlers ); 224 m_layerTreeHost->GetLayerTree()->SetHaveScrollEventHandlers(haveEentHandlers );
218 } 225 }
219 226
220 bool WebLayerTreeViewImplForTesting::haveScrollEventHandlers() const 227 bool WebLayerTreeViewImplForTesting::haveScrollEventHandlers() const
221 { 228 {
222 return m_layerTreeHost->GetLayerTree()->have_scroll_event_handlers(); 229 return m_layerTreeHost->GetLayerTree()->have_scroll_event_handlers();
223 } 230 }
224 231
225 } // namespace blink 232 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698