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

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

Issue 2884463002: Make event-targeting asynchronous in window server. (Closed)
Patch Set: rebase and use EventTargeter Created 3 years, 6 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 #ifndef SERVICES_UI_WS_TEST_UTILS_H_ 5 #ifndef SERVICES_UI_WS_TEST_UTILS_H_
6 #define SERVICES_UI_WS_TEST_UTILS_H_ 6 #define SERVICES_UI_WS_TEST_UTILS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 void OnEventAckTimeout(ClientSpecificId client_id) { 226 void OnEventAckTimeout(ClientSpecificId client_id) {
227 wms_->OnEventAckTimeout(client_id); 227 wms_->OnEventAckTimeout(client_id);
228 } 228 }
229 229
230 ClientSpecificId GetEventTargetClientId(const ServerWindow* window, 230 ClientSpecificId GetEventTargetClientId(const ServerWindow* window,
231 bool in_nonclient_area) { 231 bool in_nonclient_area) {
232 return wms_->GetEventTargetClientId(window, in_nonclient_area); 232 return wms_->GetEventTargetClientId(window, in_nonclient_area);
233 } 233 }
234 234
235 WindowTree* tree_awaiting_input_ack() { 235 WindowTree* tree_awaiting_input_ack() {
236 return wms_->in_flight_event_details_ ? wms_->in_flight_event_details_->tree 236 return wms_->in_flight_event_dispatch_details_
237 : nullptr; 237 ? wms_->in_flight_event_dispatch_details_->tree
238 : nullptr;
238 } 239 }
239 240
241 bool event_queue_empty() { return wms_->event_queue_.empty(); }
242
240 const std::vector<std::unique_ptr<WindowManagerDisplayRoot>>& 243 const std::vector<std::unique_ptr<WindowManagerDisplayRoot>>&
241 window_manager_display_roots() const { 244 window_manager_display_roots() const {
242 return wms_->window_manager_display_roots_; 245 return wms_->window_manager_display_roots_;
243 } 246 }
244 247
245 bool AckInFlightEvent(mojom::EventResult result) { 248 bool AckInFlightEvent(mojom::EventResult result) {
246 if (!wms_->in_flight_event_details_) 249 if (!wms_->in_flight_event_dispatch_details_)
247 return false; 250 return false;
248 wms_->OnEventAck(wms_->in_flight_event_details_->tree, result); 251 wms_->OnEventAck(wms_->in_flight_event_dispatch_details_->tree, result);
249 return true; 252 return true;
250 } 253 }
251 254
252 private: 255 private:
253 WindowManagerState* wms_; 256 WindowManagerState* wms_;
254 257
255 DISALLOW_COPY_AND_ASSIGN(WindowManagerStateTestApi); 258 DISALLOW_COPY_AND_ASSIGN(WindowManagerStateTestApi);
256 }; 259 };
257 260
258 // ----------------------------------------------------------------------------- 261 // -----------------------------------------------------------------------------
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 ClientWindowId* client_id = nullptr); 756 ClientWindowId* client_id = nullptr);
754 ServerWindow* NewWindowInTreeWithParent(WindowTree* tree, 757 ServerWindow* NewWindowInTreeWithParent(WindowTree* tree,
755 ServerWindow* parent, 758 ServerWindow* parent,
756 ClientWindowId* client_id = nullptr); 759 ClientWindowId* client_id = nullptr);
757 760
758 } // namespace test 761 } // namespace test
759 } // namespace ws 762 } // namespace ws
760 } // namespace ui 763 } // namespace ui
761 764
762 #endif // SERVICES_UI_WS_TEST_UTILS_H_ 765 #endif // SERVICES_UI_WS_TEST_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698