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

Side by Side Diff: components/mus/ws/test_utils.h

Issue 1818333002: Reland: mus: Enable system modal windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review comments Created 4 years, 7 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 COMPONENTS_MUS_WS_TEST_UTILS_H_ 5 #ifndef COMPONENTS_MUS_WS_TEST_UTILS_H_
6 #define COMPONENTS_MUS_WS_TEST_UTILS_H_ 6 #define COMPONENTS_MUS_WS_TEST_UTILS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 // ----------------------------------------------------------------------------- 105 // -----------------------------------------------------------------------------
106 106
107 class EventDispatcherTestApi { 107 class EventDispatcherTestApi {
108 public: 108 public:
109 explicit EventDispatcherTestApi(EventDispatcher* ed) : ed_(ed) {} 109 explicit EventDispatcherTestApi(EventDispatcher* ed) : ed_(ed) {}
110 ~EventDispatcherTestApi() {} 110 ~EventDispatcherTestApi() {}
111 111
112 bool AreAnyPointersDown() const { return ed_->AreAnyPointersDown(); } 112 bool AreAnyPointersDown() const { return ed_->AreAnyPointersDown(); }
113 bool is_mouse_button_down() const { return ed_->mouse_button_down_; } 113 bool is_mouse_button_down() const { return ed_->mouse_button_down_; }
114 bool IsObservingWindow(ServerWindow* window) { 114 bool IsWindowPointerTarget(const ServerWindow* window) const;
115 return ed_->IsObservingWindow(window); 115 int NumberPointerTargetsForWindow(ServerWindow* window);
116 ModalWindowController* modal_window_controller() const {
117 return &ed_->modal_window_controller_;
116 } 118 }
117 int NumberPointerTargetsForWindow(ServerWindow* window);
118 119
119 private: 120 private:
120 EventDispatcher* ed_; 121 EventDispatcher* ed_;
121 122
122 DISALLOW_COPY_AND_ASSIGN(EventDispatcherTestApi); 123 DISALLOW_COPY_AND_ASSIGN(EventDispatcherTestApi);
123 }; 124 };
124 125
125 // ----------------------------------------------------------------------------- 126 // -----------------------------------------------------------------------------
126 127
128 class ModalWindowControllerTestApi {
129 public:
130 explicit ModalWindowControllerTestApi(ModalWindowController* mwc)
131 : mwc_(mwc) {}
132 ~ModalWindowControllerTestApi() {}
133
134 ServerWindow* GetActiveSystemModalWindow() const {
135 return mwc_->GetActiveSystemModalWindow();
136 }
137
138 private:
139 ModalWindowController* mwc_;
140
141 DISALLOW_COPY_AND_ASSIGN(ModalWindowControllerTestApi);
142 };
143
144 // -----------------------------------------------------------------------------
145
127 class WindowManagerStateTestApi { 146 class WindowManagerStateTestApi {
128 public: 147 public:
129 explicit WindowManagerStateTestApi(WindowManagerState* wms) : wms_(wms) {} 148 explicit WindowManagerStateTestApi(WindowManagerState* wms) : wms_(wms) {}
130 ~WindowManagerStateTestApi() {} 149 ~WindowManagerStateTestApi() {}
131 150
132 void DispatchInputEventToWindow(ServerWindow* target, 151 void DispatchInputEventToWindow(ServerWindow* target,
133 bool in_nonclient_area, 152 bool in_nonclient_area,
134 const ui::Event& event, 153 const ui::Event& event,
135 Accelerator* accelerator) { 154 Accelerator* accelerator) {
136 wms_->DispatchInputEventToWindow(target, in_nonclient_area, event, 155 wms_->DispatchInputEventToWindow(target, in_nonclient_area, event,
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 428
410 // Creates a new visible window as a child of the single root of |tree|. 429 // Creates a new visible window as a child of the single root of |tree|.
411 // |client_id| set to the ClientWindowId of the new window. 430 // |client_id| set to the ClientWindowId of the new window.
412 ServerWindow* NewWindowInTree(WindowTree* tree, ClientWindowId* client_id); 431 ServerWindow* NewWindowInTree(WindowTree* tree, ClientWindowId* client_id);
413 432
414 } // namespace test 433 } // namespace test
415 } // namespace ws 434 } // namespace ws
416 } // namespace mus 435 } // namespace mus
417 436
418 #endif // COMPONENTS_MUS_WS_TEST_UTILS_H_ 437 #endif // COMPONENTS_MUS_WS_TEST_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698