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

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: Adress Dmitry's comments + sync. Created 4 years, 2 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 gfx::Size gfxSize(std::max(0, deviceViewportSize.width), std::max(0, deviceV iewportSize.height)); 81 gfx::Size gfxSize(std::max(0, deviceViewportSize.width), std::max(0, deviceV iewportSize.height));
82 m_layerTreeHost->GetLayerTree()->SetViewportSize(gfxSize); 82 m_layerTreeHost->GetLayerTree()->SetViewportSize(gfxSize);
83 } 83 }
84 84
85 void WebLayerTreeViewImplForTesting::setViewportSize(const WebSize& deviceViewpo rtSize) 85 void WebLayerTreeViewImplForTesting::setViewportSize(const WebSize& deviceViewpo rtSize)
86 { 86 {
87 gfx::Size gfxSize(std::max(0, deviceViewportSize.width), std::max(0, deviceV iewportSize.height)); 87 gfx::Size gfxSize(std::max(0, deviceViewportSize.width), std::max(0, deviceV iewportSize.height));
88 m_layerTreeHost->GetLayerTree()->SetViewportSize(gfxSize); 88 m_layerTreeHost->GetLayerTree()->SetViewportSize(gfxSize);
89 } 89 }
90 90
91 WebSize WebLayerTreeViewImplForTesting::getViewportSize() const
92 {
93 return WebSize(
94 m_layerTreeHost->GetLayerTree()->device_viewport_size().width(),
95 m_layerTreeHost->GetLayerTree()->device_viewport_size().height());
96 }
97
91 void WebLayerTreeViewImplForTesting::setDeviceScaleFactor(float deviceScaleFacto r) 98 void WebLayerTreeViewImplForTesting::setDeviceScaleFactor(float deviceScaleFacto r)
92 { 99 {
93 m_layerTreeHost->GetLayerTree()->SetDeviceScaleFactor(deviceScaleFactor); 100 m_layerTreeHost->GetLayerTree()->SetDeviceScaleFactor(deviceScaleFactor);
94 } 101 }
95 102
96 void WebLayerTreeViewImplForTesting::setBackgroundColor(WebColor color) 103 void WebLayerTreeViewImplForTesting::setBackgroundColor(WebColor color)
97 { 104 {
98 m_layerTreeHost->GetLayerTree()->set_background_color(color); 105 m_layerTreeHost->GetLayerTree()->set_background_color(color);
99 } 106 }
100 107
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 { 224 {
218 m_layerTreeHost->GetLayerTree()->SetHaveScrollEventHandlers(haveEentHandlers ); 225 m_layerTreeHost->GetLayerTree()->SetHaveScrollEventHandlers(haveEentHandlers );
219 } 226 }
220 227
221 bool WebLayerTreeViewImplForTesting::haveScrollEventHandlers() const 228 bool WebLayerTreeViewImplForTesting::haveScrollEventHandlers() const
222 { 229 {
223 return m_layerTreeHost->GetLayerTree()->have_scroll_event_handlers(); 230 return m_layerTreeHost->GetLayerTree()->have_scroll_event_handlers();
224 } 231 }
225 232
226 } // namespace blink 233 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698