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_AURA_TEST_MUS_TEST_WINDOW_TREE_CLIENT_SETUP_H_ | 5 #ifndef UI_AURA_TEST_MUS_TEST_WINDOW_TREE_CLIENT_SETUP_H_ |
6 #define UI_AURA_TEST_MUS_TEST_WINDOW_TREE_CLIENT_SETUP_H_ | 6 #define UI_AURA_TEST_MUS_TEST_WINDOW_TREE_CLIENT_SETUP_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 | 11 |
12 namespace aura { | 12 namespace aura { |
13 | 13 |
| 14 class TestWindowManagerClient; |
14 class TestWindowTree; | 15 class TestWindowTree; |
15 class WindowManagerDelegate; | 16 class WindowManagerDelegate; |
16 class WindowTreeClient; | 17 class WindowTreeClient; |
17 class WindowTreeClientDelegate; | 18 class WindowTreeClientDelegate; |
18 | 19 |
19 // TestWindowTreeClientSetup is used to create a WindowTreeClient that is not | 20 // TestWindowTreeClientSetup is used to create a WindowTreeClient that is not |
20 // connected to mus. | 21 // connected to mus. |
21 class TestWindowTreeClientSetup { | 22 class TestWindowTreeClientSetup { |
22 public: | 23 public: |
23 TestWindowTreeClientSetup(); | 24 TestWindowTreeClientSetup(); |
24 ~TestWindowTreeClientSetup(); | 25 ~TestWindowTreeClientSetup(); |
25 | 26 |
26 // Initializes the WindowTreeClient. | 27 // Initializes the WindowTreeClient. |
27 void Init(WindowTreeClientDelegate* window_tree_delegate); | 28 void Init(WindowTreeClientDelegate* window_tree_delegate); |
28 void InitForWindowManager(WindowTreeClientDelegate* window_tree_delegate, | 29 void InitForWindowManager(WindowTreeClientDelegate* window_tree_delegate, |
29 WindowManagerDelegate* window_manager_delegate); | 30 WindowManagerDelegate* window_manager_delegate); |
30 | 31 |
31 // The WindowTree that WindowTreeClient talks to. | 32 // The WindowTree that WindowTreeClient talks to. |
32 TestWindowTree* window_tree() { return window_tree_.get(); } | 33 TestWindowTree* window_tree() { return window_tree_.get(); } |
33 | 34 |
34 // Returns ownership of WindowTreeClient to the caller. | 35 // Returns ownership of WindowTreeClient to the caller. |
35 std::unique_ptr<WindowTreeClient> OwnWindowTreeClient(); | 36 std::unique_ptr<WindowTreeClient> OwnWindowTreeClient(); |
36 | 37 |
37 WindowTreeClient* window_tree_client(); | 38 WindowTreeClient* window_tree_client(); |
38 | 39 |
| 40 TestWindowManagerClient* test_window_manager_client() { |
| 41 return test_window_manager_client_.get(); |
| 42 } |
| 43 |
39 private: | 44 private: |
40 // Called by both implementations of init to perform common initialization. | 45 // Called by both implementations of init to perform common initialization. |
41 void CommonInit(WindowTreeClientDelegate* window_tree_delegate, | 46 void CommonInit(WindowTreeClientDelegate* window_tree_delegate, |
42 WindowManagerDelegate* window_manager_delegate); | 47 WindowManagerDelegate* window_manager_delegate); |
43 | 48 |
44 std::unique_ptr<TestWindowTree> window_tree_; | 49 std::unique_ptr<TestWindowTree> window_tree_; |
45 | 50 |
46 std::unique_ptr<WindowTreeClient> window_tree_client_; | 51 std::unique_ptr<WindowTreeClient> window_tree_client_; |
47 | 52 |
| 53 std::unique_ptr<TestWindowManagerClient> test_window_manager_client_; |
| 54 |
48 DISALLOW_COPY_AND_ASSIGN(TestWindowTreeClientSetup); | 55 DISALLOW_COPY_AND_ASSIGN(TestWindowTreeClientSetup); |
49 }; | 56 }; |
50 | 57 |
51 } // namespace aura | 58 } // namespace aura |
52 | 59 |
53 #endif // UI_AURA_TEST_MUS_TEST_WINDOW_TREE_CLIENT_SETUP_H_ | 60 #endif // UI_AURA_TEST_MUS_TEST_WINDOW_TREE_CLIENT_SETUP_H_ |
OLD | NEW |