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 ASH_MUS_TEST_WM_TEST_HELPER_H_ | 5 #ifndef ASH_MUS_TEST_WM_TEST_HELPER_H_ |
6 #define ASH_MUS_TEST_WM_TEST_HELPER_H_ | 6 #define ASH_MUS_TEST_WM_TEST_HELPER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "ash/mus/window_manager_application.h" | 10 #include "ash/mus/window_manager_application.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 } | 44 } |
45 | 45 |
46 // Returns the RootWindowControllers ordered by display id (which we assume | 46 // Returns the RootWindowControllers ordered by display id (which we assume |
47 // correlates with creation order). | 47 // correlates with creation order). |
48 std::vector<RootWindowController*> GetRootsOrderedByDisplayId(); | 48 std::vector<RootWindowController*> GetRootsOrderedByDisplayId(); |
49 | 49 |
50 void UpdateDisplay(const std::string& display_spec); | 50 void UpdateDisplay(const std::string& display_spec); |
51 | 51 |
52 private: | 52 private: |
53 // Creates a new RootWindowController given |display_spec|, which is the | 53 // Creates a new RootWindowController given |display_spec|, which is the |
54 // configuration of the display. | 54 // configuration of the display. On entry |next_x| is the x-coordinate to |
| 55 // place the display at, on exit |next_x| is set to the x-coordinate to place |
| 56 // the next display at. |
55 RootWindowController* CreateRootWindowController( | 57 RootWindowController* CreateRootWindowController( |
56 const std::string& display_spec); | 58 const std::string& display_spec, |
| 59 int* next_x); |
57 | 60 |
58 // Updates the display of an existing RootWindowController. | 61 // Updates the display of an existing RootWindowController. See |
| 62 // CreateRootWindowController() for details on |next_x|. |
59 void UpdateDisplay(RootWindowController* root_window_controller, | 63 void UpdateDisplay(RootWindowController* root_window_controller, |
60 const std::string& display_spec); | 64 const std::string& display_spec, |
| 65 int* next_x); |
61 | 66 |
62 // Destroys a RootWindowController. | 67 // Destroys a RootWindowController. |
63 void DestroyRootWindowController( | 68 void DestroyRootWindowController( |
64 RootWindowController* root_window_controller); | 69 RootWindowController* root_window_controller); |
65 | 70 |
66 std::unique_ptr<base::MessageLoop> message_loop_; | 71 std::unique_ptr<base::MessageLoop> message_loop_; |
67 ui::TestWindowTreeClientSetup window_tree_client_setup_; | 72 ui::TestWindowTreeClientSetup window_tree_client_setup_; |
68 std::unique_ptr<WindowManagerApplication> window_manager_app_; | 73 std::unique_ptr<WindowManagerApplication> window_manager_app_; |
69 std::unique_ptr<ui::WindowTreeClientPrivate> window_tree_client_private_; | 74 std::unique_ptr<ui::WindowTreeClientPrivate> window_tree_client_private_; |
70 | 75 |
71 // Id for the next Display created by CreateRootWindowController(). | 76 // Id for the next Display created by CreateRootWindowController(). |
72 int64_t next_display_id_ = 1; | 77 int64_t next_display_id_ = 1; |
73 | 78 |
74 std::unique_ptr<base::SequencedWorkerPoolOwner> blocking_pool_owner_; | 79 std::unique_ptr<base::SequencedWorkerPoolOwner> blocking_pool_owner_; |
75 | 80 |
76 DISALLOW_COPY_AND_ASSIGN(WmTestHelper); | 81 DISALLOW_COPY_AND_ASSIGN(WmTestHelper); |
77 }; | 82 }; |
78 | 83 |
79 } // namespace mus | 84 } // namespace mus |
80 } // namespace ash | 85 } // namespace ash |
81 | 86 |
82 #endif // ASH_MUS_TEST_WM_TEST_HELPER_H_ | 87 #endif // ASH_MUS_TEST_WM_TEST_HELPER_H_ |
OLD | NEW |