OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "mash/example/views_examples/views_examples_application_delegate.h" | 5 #include "mash/example/views_examples/views_examples_application_delegate.h" |
6 | 6 |
7 #include "services/shell/public/cpp/connection.h" | 7 #include "services/shell/public/cpp/connection.h" |
8 #include "services/shell/public/cpp/connector.h" | 8 #include "services/shell/public/cpp/connector.h" |
9 #include "ui/views/examples/example_base.h" | 9 #include "ui/views/examples/example_base.h" |
10 #include "ui/views/examples/examples_window.h" | 10 #include "ui/views/examples/examples_window.h" |
11 #include "ui/views/mus/aura_init.h" | 11 #include "ui/views/mus/aura_init.h" |
12 #include "ui/views/mus/window_manager_connection.h" | 12 #include "ui/views/mus/window_manager_connection.h" |
13 | 13 |
14 ViewsExamplesApplicationDelegate::ViewsExamplesApplicationDelegate() {} | 14 ViewsExamplesApplicationDelegate::ViewsExamplesApplicationDelegate() {} |
15 | 15 |
16 ViewsExamplesApplicationDelegate::~ViewsExamplesApplicationDelegate() { | 16 ViewsExamplesApplicationDelegate::~ViewsExamplesApplicationDelegate() { |
17 } | 17 } |
18 | 18 |
19 void ViewsExamplesApplicationDelegate::Initialize( | 19 void ViewsExamplesApplicationDelegate::Initialize( |
20 shell::Connector* connector, | 20 shell::Connector* connector, |
21 const shell::Identity& identity, | 21 const shell::Identity& identity, |
22 uint32_t id) { | 22 uint32_t id) { |
23 tracing_.Initialize(connector, identity.name()); | 23 tracing_.Initialize(connector, identity.name()); |
24 aura_init_.reset(new views::AuraInit(connector, "views_mus_resources.pak")); | 24 aura_init_.reset(new views::AuraInit(connector, "views_mus_resources.pak")); |
25 views::WindowManagerConnection::Create(connector); | 25 views::WindowManagerConnection::Create(connector, identity); |
26 } | 26 } |
27 | 27 |
28 bool ViewsExamplesApplicationDelegate::AcceptConnection( | 28 bool ViewsExamplesApplicationDelegate::AcceptConnection( |
29 shell::Connection* connection) { | 29 shell::Connection* connection) { |
30 connection->AddInterface<mash::mojom::Launchable>(this); | 30 connection->AddInterface<mash::mojom::Launchable>(this); |
31 return true; | 31 return true; |
32 } | 32 } |
33 | 33 |
34 void ViewsExamplesApplicationDelegate::Launch(uint32_t what, | 34 void ViewsExamplesApplicationDelegate::Launch(uint32_t what, |
35 mash::mojom::LaunchMode how) { | 35 mash::mojom::LaunchMode how) { |
36 views::examples::ShowExamplesWindow(views::examples::QUIT_ON_CLOSE, | 36 views::examples::ShowExamplesWindow(views::examples::QUIT_ON_CLOSE, |
37 nullptr, nullptr); | 37 nullptr, nullptr); |
38 } | 38 } |
39 | 39 |
40 void ViewsExamplesApplicationDelegate::Create( | 40 void ViewsExamplesApplicationDelegate::Create( |
41 shell::Connection* connection, | 41 shell::Connection* connection, |
42 mash::mojom::LaunchableRequest request) { | 42 mash::mojom::LaunchableRequest request) { |
43 bindings_.AddBinding(this, std::move(request)); | 43 bindings_.AddBinding(this, std::move(request)); |
44 } | 44 } |
OLD | NEW |