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

Unified Diff: services/ui/demo/mus_demo_internal.cc

Issue 2755673003: Allow parallel creation of windows
Patch Set: nits Created 3 years, 9 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 | « services/ui/demo/mus_demo_external.cc ('k') | services/ui/demo/window_tree_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/demo/mus_demo_internal.cc
diff --git a/services/ui/demo/mus_demo_internal.cc b/services/ui/demo/mus_demo_internal.cc
index 6c2125692fa142f61cc57ce1945e241549a8c72f..5deedba923fd97ae4d1c1c63902499c73704b85b 100644
--- a/services/ui/demo/mus_demo_internal.cc
+++ b/services/ui/demo/mus_demo_internal.cc
@@ -14,6 +14,22 @@ namespace demo {
namespace {
+class WindowTreeDataInternal : public WindowTreeData {
+ public:
+ // Creates a new window tree host associated to the WindowTreeData.
+ WindowTreeDataInternal(
+ std::unique_ptr<aura::WindowTreeHostMus> window_tree_host,
+ int square_size)
+ : WindowTreeData(square_size) {
+ DCHECK(window_tree_host);
+ window_tree_host->InitHost();
+ window_tree_host->Show();
+ SetWindowTreeHost(std::move(window_tree_host));
+ }
+
+ DISALLOW_COPY_AND_ASSIGN(WindowTreeDataInternal);
+};
+
// Size of square in pixels to draw.
const int kSquareSize = 300;
}
@@ -70,8 +86,11 @@ void MusDemoInternal::OnWmWillCreateDisplay(const display::Display& display) {
void MusDemoInternal::OnWmNewDisplay(
std::unique_ptr<aura::WindowTreeHostMus> window_tree_host,
const display::Display& display) {
- AppendWindowTreeData(base::MakeUnique<WindowTreeData>(kSquareSize));
- InitWindowTreeData(std::move(window_tree_host));
+ std::unique_ptr<WindowTreeDataInternal> window_tree_data =
+ base::MakeUnique<WindowTreeDataInternal>(std::move(window_tree_host),
+ kSquareSize);
+ window_tree_data->Init();
+ AppendWindowTreeData(std::move(window_tree_data));
}
void MusDemoInternal::OnWmDisplayRemoved(
« no previous file with comments | « services/ui/demo/mus_demo_external.cc ('k') | services/ui/demo/window_tree_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698