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() = default; |
| 17 |
| 18 std::unique_ptr<WindowTreeHostMusInitParams> CreateInitParamsForTopLevel( |
| 19 WindowTreeClient* window_tree_client, |
| 20 std::map<std::string, std::vector<uint8_t>> properties) { |
| 21 std::unique_ptr<WindowTreeHostMusInitParams> params = |
| 22 base::MakeUnique<WindowTreeHostMusInitParams>(); |
| 23 params->window_tree_client = window_tree_client; |
| 24 params->display_id = display::Screen::GetScreen()->GetPrimaryDisplay().id(); |
| 25 // Pass |properties| to CreateWindowPortForTopLevel() so that |properties| |
| 26 // are passed to the server *and* pass |properties| to the WindowTreeHostMus |
| 27 // constructor (above) which applies the properties to the Window. Some of the |
| 28 // properties may be server specific and not applied to the Window. |
| 29 params->window_port = |
| 30 static_cast<WindowTreeHostMusDelegate*>(window_tree_client) |
| 31 ->CreateWindowPortForTopLevel(&properties); |
| 32 params->properties = std::move(properties); |
| 33 return params; |
| 34 } |
| 35 |
| 36 } // namespace aura |
OLD | NEW |