OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "services/ui/public/cpp/tests/test_window_tree_client_setup.h" | |
6 | |
7 #include "services/ui/public/cpp/tests/test_window_tree.h" | |
8 #include "services/ui/public/cpp/tests/window_tree_client_private.h" | |
9 #include "services/ui/public/cpp/window_tree_client.h" | |
10 #include "ui/display/display.h" | |
11 | |
12 namespace ui { | |
13 | |
14 TestWindowTreeClientSetup::TestWindowTreeClientSetup() {} | |
15 | |
16 TestWindowTreeClientSetup::~TestWindowTreeClientSetup() {} | |
17 | |
18 void TestWindowTreeClientSetup::Init( | |
19 WindowTreeClientDelegate* window_tree_delegate) { | |
20 CommonInit(window_tree_delegate, nullptr); | |
21 WindowTreeClientPrivate(window_tree_client_.get()) | |
22 .OnEmbed(window_tree_.get()); | |
23 } | |
24 | |
25 void TestWindowTreeClientSetup::InitForWindowManager( | |
26 WindowTreeClientDelegate* window_tree_delegate, | |
27 WindowManagerDelegate* window_manager_delegate) { | |
28 CommonInit(window_tree_delegate, window_manager_delegate); | |
29 WindowTreeClientPrivate(window_tree_client_.get()) | |
30 .SetTreeAndClientId(window_tree_.get(), 1); | |
31 } | |
32 | |
33 std::unique_ptr<WindowTreeClient> | |
34 TestWindowTreeClientSetup::OwnWindowTreeClient() { | |
35 DCHECK(window_tree_client_); | |
36 return std::move(window_tree_client_); | |
37 } | |
38 | |
39 WindowTreeClient* TestWindowTreeClientSetup::window_tree_client() { | |
40 return window_tree_client_.get(); | |
41 } | |
42 | |
43 void TestWindowTreeClientSetup::CommonInit( | |
44 WindowTreeClientDelegate* window_tree_delegate, | |
45 WindowManagerDelegate* window_manager_delegate) { | |
46 window_tree_.reset(new TestWindowTree); | |
47 window_tree_client_.reset(new WindowTreeClient( | |
48 window_tree_delegate, window_manager_delegate, nullptr)); | |
49 } | |
50 | |
51 } // namespace ui | |
OLD | NEW |