| 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::OnStart( | 19 void ViewsExamplesApplicationDelegate::OnStart( |
| 20 shell::Connector* connector, | 20 const shell::Identity& identity) { |
| 21 const shell::Identity& identity, | 21 tracing_.Initialize(connector(), identity.name()); |
| 22 uint32_t id) { | 22 aura_init_.reset(new views::AuraInit(connector(), "views_mus_resources.pak")); |
| 23 tracing_.Initialize(connector, identity.name()); | |
| 24 aura_init_.reset(new views::AuraInit(connector, "views_mus_resources.pak")); | |
| 25 window_manager_connection_ = | 23 window_manager_connection_ = |
| 26 views::WindowManagerConnection::Create(connector, identity); | 24 views::WindowManagerConnection::Create(connector(), identity); |
| 27 } | 25 } |
| 28 | 26 |
| 29 bool ViewsExamplesApplicationDelegate::OnConnect( | 27 bool ViewsExamplesApplicationDelegate::OnConnect( |
| 30 shell::Connection* connection) { | 28 shell::Connection* connection) { |
| 31 connection->AddInterface<mash::mojom::Launchable>(this); | 29 connection->AddInterface<mash::mojom::Launchable>(this); |
| 32 return true; | 30 return true; |
| 33 } | 31 } |
| 34 | 32 |
| 35 void ViewsExamplesApplicationDelegate::Launch(uint32_t what, | 33 void ViewsExamplesApplicationDelegate::Launch(uint32_t what, |
| 36 mash::mojom::LaunchMode how) { | 34 mash::mojom::LaunchMode how) { |
| 37 views::examples::ShowExamplesWindow(views::examples::QUIT_ON_CLOSE, | 35 views::examples::ShowExamplesWindow(views::examples::QUIT_ON_CLOSE, |
| 38 nullptr, nullptr); | 36 nullptr, nullptr); |
| 39 } | 37 } |
| 40 | 38 |
| 41 void ViewsExamplesApplicationDelegate::Create( | 39 void ViewsExamplesApplicationDelegate::Create( |
| 42 const shell::Identity& remote_identity, | 40 const shell::Identity& remote_identity, |
| 43 mash::mojom::LaunchableRequest request) { | 41 mash::mojom::LaunchableRequest request) { |
| 44 bindings_.AddBinding(this, std::move(request)); | 42 bindings_.AddBinding(this, std::move(request)); |
| 45 } | 43 } |
| OLD | NEW |