| 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 UI_VIEWS_MUS_TEST_UTILS_H_ | 5 #ifndef UI_VIEWS_MUS_TEST_UTILS_H_ |
| 6 #define UI_VIEWS_MUS_TEST_UTILS_H_ | 6 #define UI_VIEWS_MUS_TEST_UTILS_H_ |
| 7 | 7 |
| 8 #include "base/memory/ptr_util.h" |
| 9 #include "ui/views/mus/mus_client.h" |
| 8 #include "ui/views/mus/window_manager_connection.h" | 10 #include "ui/views/mus/window_manager_connection.h" |
| 9 | 11 |
| 10 namespace views { | 12 namespace views { |
| 11 namespace test { | 13 namespace test { |
| 12 | 14 |
| 13 class WindowManagerConnectionTestApi { | 15 class WindowManagerConnectionTestApi { |
| 14 public: | 16 public: |
| 15 explicit WindowManagerConnectionTestApi(WindowManagerConnection* connection) | 17 explicit WindowManagerConnectionTestApi(WindowManagerConnection* connection) |
| 16 : connection_(connection) {} | 18 : connection_(connection) {} |
| 17 ~WindowManagerConnectionTestApi() {} | 19 ~WindowManagerConnectionTestApi() {} |
| 18 | 20 |
| 19 ui::Window* GetUiWindowAtScreenPoint(const gfx::Point& point) { | 21 ui::Window* GetUiWindowAtScreenPoint(const gfx::Point& point) { |
| 20 return connection_->GetUiWindowAtScreenPoint(point); | 22 return connection_->GetUiWindowAtScreenPoint(point); |
| 21 } | 23 } |
| 22 | 24 |
| 23 ScreenMus* screen() { return connection_->screen_.get(); } | 25 ScreenMus* screen() { return connection_->screen_.get(); } |
| 24 | 26 |
| 25 private: | 27 private: |
| 26 WindowManagerConnection* connection_; | 28 WindowManagerConnection* connection_; |
| 27 | 29 |
| 28 DISALLOW_COPY_AND_ASSIGN(WindowManagerConnectionTestApi); | 30 DISALLOW_COPY_AND_ASSIGN(WindowManagerConnectionTestApi); |
| 29 }; | 31 }; |
| 30 | 32 |
| 33 class MusClientTestApi { |
| 34 public: |
| 35 static std::unique_ptr<MusClient> Create( |
| 36 service_manager::Connector* connector, |
| 37 const service_manager::Identity& identity) { |
| 38 return base::WrapUnique(new MusClient(connector, identity)); |
| 39 } |
| 40 |
| 41 private: |
| 42 DISALLOW_IMPLICIT_CONSTRUCTORS(MusClientTestApi); |
| 43 }; |
| 44 |
| 31 } // namespace test | 45 } // namespace test |
| 32 } // namespace views | 46 } // namespace views |
| 33 | 47 |
| 34 #endif // UI_VIEWS_MUS_TEST_UTILS_H_ | 48 #endif // UI_VIEWS_MUS_TEST_UTILS_H_ |
| OLD | NEW |