OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "services/ui/ws/test_utils.h" | 5 #include "services/ui/ws/test_utils.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "cc/output/copy_output_request.h" | 10 #include "cc/output/copy_output_request.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 const ViewportMetrics& TestFrameGeneratorDelegate::GetViewportMetrics() { | 133 const ViewportMetrics& TestFrameGeneratorDelegate::GetViewportMetrics() { |
134 return metrics_; | 134 return metrics_; |
135 } | 135 } |
136 | 136 |
137 // WindowTreeTestApi --------------------------------------------------------- | 137 // WindowTreeTestApi --------------------------------------------------------- |
138 | 138 |
139 WindowTreeTestApi::WindowTreeTestApi(WindowTree* tree) : tree_(tree) {} | 139 WindowTreeTestApi::WindowTreeTestApi(WindowTree* tree) : tree_(tree) {} |
140 WindowTreeTestApi::~WindowTreeTestApi() {} | 140 WindowTreeTestApi::~WindowTreeTestApi() {} |
141 | 141 |
142 void WindowTreeTestApi::SetEventObserver(mojom::EventMatcherPtr matcher, | 142 void WindowTreeTestApi::StartPointerWatcher(bool want_moves, |
143 uint32_t event_observer_id) { | 143 uint32_t pointer_watcher_id) { |
144 tree_->SetEventObserver(std::move(matcher), event_observer_id); | 144 tree_->StartPointerWatcher(want_moves, pointer_watcher_id); |
| 145 } |
| 146 |
| 147 void WindowTreeTestApi::StopPointerWatcher() { |
| 148 tree_->StopPointerWatcher(); |
145 } | 149 } |
146 | 150 |
147 // DisplayTestApi ------------------------------------------------------------ | 151 // DisplayTestApi ------------------------------------------------------------ |
148 | 152 |
149 DisplayTestApi::DisplayTestApi(Display* display) : display_(display) {} | 153 DisplayTestApi::DisplayTestApi(Display* display) : display_(display) {} |
150 DisplayTestApi::~DisplayTestApi() {} | 154 DisplayTestApi::~DisplayTestApi() {} |
151 | 155 |
152 // EventDispatcherTestApi ---------------------------------------------------- | 156 // EventDispatcherTestApi ---------------------------------------------------- |
153 | 157 |
154 bool EventDispatcherTestApi::IsWindowPointerTarget( | 158 bool EventDispatcherTestApi::IsWindowPointerTarget( |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 tracker_.OnWindowSharedPropertyChanged(window, name, std::move(new_data)); | 313 tracker_.OnWindowSharedPropertyChanged(window, name, std::move(new_data)); |
310 } | 314 } |
311 | 315 |
312 void TestWindowTreeClient::OnWindowInputEvent(uint32_t event_id, | 316 void TestWindowTreeClient::OnWindowInputEvent(uint32_t event_id, |
313 uint32_t window, | 317 uint32_t window, |
314 std::unique_ptr<ui::Event> event, | 318 std::unique_ptr<ui::Event> event, |
315 uint32_t event_observer_id) { | 319 uint32_t event_observer_id) { |
316 tracker_.OnWindowInputEvent(window, *event.get(), event_observer_id); | 320 tracker_.OnWindowInputEvent(window, *event.get(), event_observer_id); |
317 } | 321 } |
318 | 322 |
319 void TestWindowTreeClient::OnEventObserved(std::unique_ptr<ui::Event> event, | 323 void TestWindowTreeClient::OnPointerEventObserved( |
320 uint32_t event_observer_id) { | 324 std::unique_ptr<ui::Event> event, |
321 tracker_.OnEventObserved(*event.get(), event_observer_id); | 325 uint32_t event_observer_id) { |
| 326 tracker_.OnPointerEventObserved(*event.get(), event_observer_id); |
322 } | 327 } |
323 | 328 |
324 void TestWindowTreeClient::OnWindowFocused(uint32_t focused_window_id) { | 329 void TestWindowTreeClient::OnWindowFocused(uint32_t focused_window_id) { |
325 tracker_.OnWindowFocused(focused_window_id); | 330 tracker_.OnWindowFocused(focused_window_id); |
326 } | 331 } |
327 | 332 |
328 void TestWindowTreeClient::OnWindowPredefinedCursorChanged( | 333 void TestWindowTreeClient::OnWindowPredefinedCursorChanged( |
329 uint32_t window_id, | 334 uint32_t window_id, |
330 mojom::Cursor cursor_id) { | 335 mojom::Cursor cursor_id) { |
331 tracker_.OnWindowPredefinedCursorChanged(window_id, cursor_id); | 336 tracker_.OnWindowPredefinedCursorChanged(window_id, cursor_id); |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 return nullptr; | 529 return nullptr; |
525 if (!tree->AddWindow(parent_client_id, client_window_id)) | 530 if (!tree->AddWindow(parent_client_id, client_window_id)) |
526 return nullptr; | 531 return nullptr; |
527 *client_id = client_window_id; | 532 *client_id = client_window_id; |
528 return tree->GetWindowByClientId(client_window_id); | 533 return tree->GetWindowByClientId(client_window_id); |
529 } | 534 } |
530 | 535 |
531 } // namespace test | 536 } // namespace test |
532 } // namespace ws | 537 } // namespace ws |
533 } // namespace ui | 538 } // namespace ui |
OLD | NEW |