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

Side by Side Diff: services/ui/ws/test_utils.cc

Issue 2183163002: mus: Change PointerWatcher to observe all pointer events, with moves optional. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renames, PointerEvent, tests etc Created 4 years, 4 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 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 130
131 const ViewportMetrics& TestFrameGeneratorDelegate::GetViewportMetrics() { 131 const ViewportMetrics& TestFrameGeneratorDelegate::GetViewportMetrics() {
132 return metrics_; 132 return metrics_;
133 } 133 }
134 134
135 // WindowTreeTestApi --------------------------------------------------------- 135 // WindowTreeTestApi ---------------------------------------------------------
136 136
137 WindowTreeTestApi::WindowTreeTestApi(WindowTree* tree) : tree_(tree) {} 137 WindowTreeTestApi::WindowTreeTestApi(WindowTree* tree) : tree_(tree) {}
138 WindowTreeTestApi::~WindowTreeTestApi() {} 138 WindowTreeTestApi::~WindowTreeTestApi() {}
139 139
140 void WindowTreeTestApi::SetEventObserver(mojom::EventMatcherPtr matcher, 140 void WindowTreeTestApi::StartPointerWatcher(bool want_moves,
141 uint32_t event_observer_id) { 141 uint32_t pointer_watcher_id) {
142 tree_->SetEventObserver(std::move(matcher), event_observer_id); 142 tree_->StartPointerWatcher(want_moves, pointer_watcher_id);
143 }
144
145 void WindowTreeTestApi::StopPointerWatcher() {
146 tree_->StopPointerWatcher();
143 } 147 }
144 148
145 // DisplayTestApi ------------------------------------------------------------ 149 // DisplayTestApi ------------------------------------------------------------
146 150
147 DisplayTestApi::DisplayTestApi(Display* display) : display_(display) {} 151 DisplayTestApi::DisplayTestApi(Display* display) : display_(display) {}
148 DisplayTestApi::~DisplayTestApi() {} 152 DisplayTestApi::~DisplayTestApi() {}
149 153
150 // EventDispatcherTestApi ---------------------------------------------------- 154 // EventDispatcherTestApi ----------------------------------------------------
151 155
152 bool EventDispatcherTestApi::IsWindowPointerTarget( 156 bool EventDispatcherTestApi::IsWindowPointerTarget(
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 tracker_.OnWindowSharedPropertyChanged(window, name, std::move(new_data)); 311 tracker_.OnWindowSharedPropertyChanged(window, name, std::move(new_data));
308 } 312 }
309 313
310 void TestWindowTreeClient::OnWindowInputEvent(uint32_t event_id, 314 void TestWindowTreeClient::OnWindowInputEvent(uint32_t event_id,
311 uint32_t window, 315 uint32_t window,
312 std::unique_ptr<ui::Event> event, 316 std::unique_ptr<ui::Event> event,
313 uint32_t event_observer_id) { 317 uint32_t event_observer_id) {
314 tracker_.OnWindowInputEvent(window, *event.get(), event_observer_id); 318 tracker_.OnWindowInputEvent(window, *event.get(), event_observer_id);
315 } 319 }
316 320
317 void TestWindowTreeClient::OnEventObserved(std::unique_ptr<ui::Event> event, 321 void TestWindowTreeClient::OnPointerWatcherEvent(
318 uint32_t event_observer_id) { 322 std::unique_ptr<ui::Event> event,
319 tracker_.OnEventObserved(*event.get(), event_observer_id); 323 uint32_t event_observer_id) {
324 tracker_.OnPointerWatcherEvent(*event.get(), event_observer_id);
320 } 325 }
321 326
322 void TestWindowTreeClient::OnWindowFocused(uint32_t focused_window_id) { 327 void TestWindowTreeClient::OnWindowFocused(uint32_t focused_window_id) {
323 tracker_.OnWindowFocused(focused_window_id); 328 tracker_.OnWindowFocused(focused_window_id);
324 } 329 }
325 330
326 void TestWindowTreeClient::OnWindowPredefinedCursorChanged( 331 void TestWindowTreeClient::OnWindowPredefinedCursorChanged(
327 uint32_t window_id, 332 uint32_t window_id,
328 mojom::Cursor cursor_id) { 333 mojom::Cursor cursor_id) {
329 tracker_.OnWindowPredefinedCursorChanged(window_id, cursor_id); 334 tracker_.OnWindowPredefinedCursorChanged(window_id, cursor_id);
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 return nullptr; 527 return nullptr;
523 if (!tree->AddWindow(parent_client_id, client_window_id)) 528 if (!tree->AddWindow(parent_client_id, client_window_id))
524 return nullptr; 529 return nullptr;
525 *client_id = client_window_id; 530 *client_id = client_window_id;
526 return tree->GetWindowByClientId(client_window_id); 531 return tree->GetWindowByClientId(client_window_id);
527 } 532 }
528 533
529 } // namespace test 534 } // namespace test
530 } // namespace ws 535 } // namespace ws
531 } // namespace ui 536 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698