OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 "ui/aura/mus/window_tree_host_mus_init_params.h" |
| 6 |
| 7 #include "ui/aura/mus/window_port_mus.h" |
| 8 #include "ui/aura/mus/window_tree_client.h" |
| 9 #include "ui/display/display.h" |
| 10 #include "ui/display/screen.h" |
| 11 |
| 12 namespace aura { |
| 13 |
| 14 WindowTreeHostMusInitParams::WindowTreeHostMusInitParams() = default; |
| 15 |
| 16 WindowTreeHostMusInitParams::WindowTreeHostMusInitParams( |
| 17 WindowTreeHostMusInitParams&& other) = default; |
| 18 |
| 19 WindowTreeHostMusInitParams::~WindowTreeHostMusInitParams() = default; |
| 20 |
| 21 WindowTreeHostMusInitParams CreateInitParamsForTopLevel( |
| 22 WindowTreeClient* window_tree_client, |
| 23 std::map<std::string, std::vector<uint8_t>> properties) { |
| 24 WindowTreeHostMusInitParams params; |
| 25 params.window_tree_client = window_tree_client; |
| 26 params.display_id = display::Screen::GetScreen()->GetPrimaryDisplay().id(); |
| 27 // Pass |properties| to CreateWindowPortForTopLevel() so that |properties| |
| 28 // are passed to the server *and* pass |properties| to the WindowTreeHostMus |
| 29 // constructor (above) which applies the properties to the Window. Some of the |
| 30 // properties may be server specific and not applied to the Window. |
| 31 params.window_port = |
| 32 static_cast<WindowTreeHostMusDelegate*>(window_tree_client) |
| 33 ->CreateWindowPortForTopLevel(&properties); |
| 34 params.properties = std::move(properties); |
| 35 return params; |
| 36 } |
| 37 |
| 38 } // namespace aura |
OLD | NEW |