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

Side by Side Diff: services/ui/demo/mus_demo.cc

Issue 2622103004: Mus Demo: Demonstrate external window mode (Closed)
Patch Set: Add MusDemoExternal Created 3 years, 10 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "services/ui/demo/mus_demo.h" 5 #include "services/ui/demo/mus_demo.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "services/service_manager/public/cpp/connector.h" 9 #include "services/service_manager/public/cpp/connector.h"
10 #include "services/ui/public/cpp/gpu/gpu.h" 10 #include "services/ui/public/cpp/gpu/gpu.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 } // namespace 66 } // namespace
67 67
68 MusDemo::WindowTreeData::WindowTreeData( 68 MusDemo::WindowTreeData::WindowTreeData(
69 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host, 69 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host,
70 int square_size) 70 int square_size)
71 : square_size_(square_size) { 71 : square_size_(square_size) {
72 Init(std::move(window_tree_host)); 72 Init(std::move(window_tree_host));
73 } 73 }
74 74
75 MusDemo::WindowTreeData::WindowTreeData(mojom::WindowTreeHostFactory* factory,
76 mojom::WindowTreeClientPtr tree_client,
77 int square_size)
78 : square_size_(square_size) {
79 factory->CreateWindowTreeHost(MakeRequest(&host_), std::move(tree_client));
80 }
81
75 MusDemo::WindowTreeData::~WindowTreeData() {} 82 MusDemo::WindowTreeData::~WindowTreeData() {}
76 83
77 aura::Window* MusDemo::WindowTreeData::bitmap_window() { 84 aura::Window* MusDemo::WindowTreeData::bitmap_window() {
78 DCHECK(!window_tree_host_->window()->children().empty()); 85 DCHECK(!window_tree_host_->window()->children().empty());
79 return window_tree_host_->window()->children()[0]; 86 return window_tree_host_->window()->children()[0];
80 } 87 }
81 88
82 void MusDemo::WindowTreeData::Init( 89 void MusDemo::WindowTreeData::Init(
83 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host) { 90 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host) {
84 window_tree_host->InitHost(); 91 window_tree_host->InitHost();
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 182
176 void MusDemo::OnPointerEventObserved(const PointerEvent& event, 183 void MusDemo::OnPointerEventObserved(const PointerEvent& event,
177 aura::Window* target) {} 184 aura::Window* target) {}
178 185
179 aura::PropertyConverter* MusDemo::GetPropertyConverter() { 186 aura::PropertyConverter* MusDemo::GetPropertyConverter() {
180 return property_converter_.get(); 187 return property_converter_.get();
181 } 188 }
182 189
183 } // namespace demo 190 } // namespace demo
184 } // namespace aura 191 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698