| Index: services/ui/demo/mus_demo_external.cc
|
| diff --git a/services/ui/demo/mus_demo_external.cc b/services/ui/demo/mus_demo_external.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..63bd5f707345d54a186fd7637e621200bbc46df8
|
| --- /dev/null
|
| +++ b/services/ui/demo/mus_demo_external.cc
|
| @@ -0,0 +1,48 @@
|
| +// 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 "services/ui/demo/mus_demo_external.h"
|
| +
|
| +#include "services/service_manager/public/cpp/service_context.h"
|
| +#include "services/ui/demo/window_tree_data.h"
|
| +#include "services/ui/public/interfaces/constants.mojom.h"
|
| +#include "ui/aura/mus/window_tree_client.h"
|
| +#include "ui/aura/mus/window_tree_host_mus.h"
|
| +
|
| +namespace ui {
|
| +namespace demo {
|
| +
|
| +// Size of square in pixels to draw.
|
| +const int kSquareSize = 500;
|
| +
|
| +MusDemoExternal::MusDemoExternal() {}
|
| +
|
| +MusDemoExternal::~MusDemoExternal() {}
|
| +
|
| +void MusDemoExternal::OnStartImpl(
|
| + std::unique_ptr<aura::WindowTreeClient>& window_tree_client,
|
| + std::unique_ptr<WindowTreeData>& window_tree_data) {
|
| + context()->connector()->BindInterface(ui::mojom::kServiceName,
|
| + &window_tree_host_factory_);
|
| + mojom::WindowTreeClientPtr tree_client;
|
| + window_tree_client = base::MakeUnique<aura::WindowTreeClient>(
|
| + context()->connector(), this, nullptr, MakeRequest(&tree_client));
|
| + // TODO(tonikitoo,fwang): Open two external windows with different square
|
| + // sizes.
|
| + window_tree_data = base::MakeUnique<WindowTreeData>(
|
| + window_tree_host_factory_.get(), std::move(tree_client), kSquareSize);
|
| +}
|
| +
|
| +void MusDemoExternal::OnEmbed(
|
| + std::unique_ptr<aura::WindowTreeHostMus> window_tree_host) {
|
| + InitWindowTreeData(std::move(window_tree_host));
|
| +}
|
| +
|
| +void MusDemoExternal::OnEmbedRootDestroyed(
|
| + aura::WindowTreeHostMus* window_tree_host) {
|
| + CleanupWindowTreeData();
|
| +}
|
| +
|
| +} // namespace demo
|
| +} // namespace ui
|
|
|