| 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 #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 Loading... |
| 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 IsWindowPointerTarget(const ServerWindow* window) const; | 114 bool IsObservingWindow(ServerWindow* window) { |
| 115 return ed_->IsObservingWindow(window); |
| 116 } |
| 115 int NumberPointerTargetsForWindow(ServerWindow* window); | 117 int NumberPointerTargetsForWindow(ServerWindow* window); |
| 116 ModalWindowController* modal_window_controller() const { | |
| 117 return &ed_->modal_window_controller_; | |
| 118 } | |
| 119 | 118 |
| 120 private: | 119 private: |
| 121 EventDispatcher* ed_; | 120 EventDispatcher* ed_; |
| 122 | 121 |
| 123 DISALLOW_COPY_AND_ASSIGN(EventDispatcherTestApi); | 122 DISALLOW_COPY_AND_ASSIGN(EventDispatcherTestApi); |
| 124 }; | 123 }; |
| 125 | 124 |
| 126 // ----------------------------------------------------------------------------- | 125 // ----------------------------------------------------------------------------- |
| 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 | 126 |
| 146 class WindowManagerStateTestApi { | 127 class WindowManagerStateTestApi { |
| 147 public: | 128 public: |
| 148 explicit WindowManagerStateTestApi(WindowManagerState* wms) : wms_(wms) {} | 129 explicit WindowManagerStateTestApi(WindowManagerState* wms) : wms_(wms) {} |
| 149 ~WindowManagerStateTestApi() {} | 130 ~WindowManagerStateTestApi() {} |
| 150 | 131 |
| 151 void DispatchInputEventToWindow(ServerWindow* target, | 132 void DispatchInputEventToWindow(ServerWindow* target, |
| 152 bool in_nonclient_area, | 133 bool in_nonclient_area, |
| 153 const ui::Event& event, | 134 const ui::Event& event, |
| 154 Accelerator* accelerator) { | 135 Accelerator* accelerator) { |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 | 409 |
| 429 // Creates a new visible window as a child of the single root of |tree|. | 410 // Creates a new visible window as a child of the single root of |tree|. |
| 430 // |client_id| set to the ClientWindowId of the new window. | 411 // |client_id| set to the ClientWindowId of the new window. |
| 431 ServerWindow* NewWindowInTree(WindowTree* tree, ClientWindowId* client_id); | 412 ServerWindow* NewWindowInTree(WindowTree* tree, ClientWindowId* client_id); |
| 432 | 413 |
| 433 } // namespace test | 414 } // namespace test |
| 434 } // namespace ws | 415 } // namespace ws |
| 435 } // namespace mus | 416 } // namespace mus |
| 436 | 417 |
| 437 #endif // COMPONENTS_MUS_WS_TEST_UTILS_H_ | 418 #endif // COMPONENTS_MUS_WS_TEST_UTILS_H_ |
| OLD | NEW |