Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: ui/aura/mus/window_tree_host_mus_init_params.cc

Issue 2823903005: Extracts parameters to WindowTreeHostMus into structure (Closed)
Patch Set: move constructor Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW
« no previous file with comments | « ui/aura/mus/window_tree_host_mus_init_params.h ('k') | ui/aura/mus/window_tree_host_mus_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698