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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/mus/window_tree_host_mus_init_params.cc
diff --git a/ui/aura/mus/window_tree_host_mus_init_params.cc b/ui/aura/mus/window_tree_host_mus_init_params.cc
new file mode 100644
index 0000000000000000000000000000000000000000..10daf0f18b9d348fcfd822f25ca4267675da3942
--- /dev/null
+++ b/ui/aura/mus/window_tree_host_mus_init_params.cc
@@ -0,0 +1,38 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/aura/mus/window_tree_host_mus_init_params.h"
+
+#include "ui/aura/mus/window_port_mus.h"
+#include "ui/aura/mus/window_tree_client.h"
+#include "ui/display/display.h"
+#include "ui/display/screen.h"
+
+namespace aura {
+
+WindowTreeHostMusInitParams::WindowTreeHostMusInitParams() = default;
+
+WindowTreeHostMusInitParams::WindowTreeHostMusInitParams(
+ WindowTreeHostMusInitParams&& other) = default;
+
+WindowTreeHostMusInitParams::~WindowTreeHostMusInitParams() = default;
+
+WindowTreeHostMusInitParams CreateInitParamsForTopLevel(
+ WindowTreeClient* window_tree_client,
+ std::map<std::string, std::vector<uint8_t>> properties) {
+ WindowTreeHostMusInitParams params;
+ params.window_tree_client = window_tree_client;
+ params.display_id = display::Screen::GetScreen()->GetPrimaryDisplay().id();
+ // Pass |properties| to CreateWindowPortForTopLevel() so that |properties|
+ // are passed to the server *and* pass |properties| to the WindowTreeHostMus
+ // constructor (above) which applies the properties to the Window. Some of the
+ // properties may be server specific and not applied to the Window.
+ params.window_port =
+ static_cast<WindowTreeHostMusDelegate*>(window_tree_client)
+ ->CreateWindowPortForTopLevel(&properties);
+ params.properties = std::move(properties);
+ return params;
+}
+
+} // namespace aura
« 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