OLD | NEW |
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 "ash/touch_hud/mus/touch_hud_application.h" | 5 #include "ash/touch_hud/mus/touch_hud_application.h" |
6 | 6 |
7 #include "ash/public/cpp/shell_window_ids.h" | 7 #include "ash/public/cpp/shell_window_ids.h" |
8 #include "ash/touch_hud/touch_hud_renderer.h" | 8 #include "ash/touch_hud/touch_hud_renderer.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 DISALLOW_COPY_AND_ASSIGN(TouchHudUI); | 62 DISALLOW_COPY_AND_ASSIGN(TouchHudUI); |
63 }; | 63 }; |
64 | 64 |
65 TouchHudApplication::TouchHudApplication() : binding_(this) { | 65 TouchHudApplication::TouchHudApplication() : binding_(this) { |
66 registry_.AddInterface<mash::mojom::Launchable>( | 66 registry_.AddInterface<mash::mojom::Launchable>( |
67 base::Bind(&TouchHudApplication::Create, base::Unretained(this))); | 67 base::Bind(&TouchHudApplication::Create, base::Unretained(this))); |
68 } | 68 } |
69 TouchHudApplication::~TouchHudApplication() {} | 69 TouchHudApplication::~TouchHudApplication() {} |
70 | 70 |
71 void TouchHudApplication::OnStart() { | 71 void TouchHudApplication::OnStart() { |
72 aura_init_ = base::MakeUnique<views::AuraInit>( | 72 aura_init_ = base::MakeUnique<views::AuraInit>(); |
73 context()->connector(), context()->identity(), "views_mus_resources.pak", | 73 if (!aura_init_->Init(context()->connector(), context()->identity(), |
74 std::string(), nullptr, views::AuraInit::Mode::AURA_MUS); | 74 "views_mus_resources.pak", std::string(), nullptr, |
| 75 views::AuraInit::Mode::AURA_MUS)) { |
| 76 context()->QuitNow(); |
| 77 } |
75 } | 78 } |
76 | 79 |
77 void TouchHudApplication::OnBindInterface( | 80 void TouchHudApplication::OnBindInterface( |
78 const service_manager::BindSourceInfo& source_info, | 81 const service_manager::BindSourceInfo& source_info, |
79 const std::string& interface_name, | 82 const std::string& interface_name, |
80 mojo::ScopedMessagePipeHandle interface_pipe) { | 83 mojo::ScopedMessagePipeHandle interface_pipe) { |
81 registry_.BindInterface(source_info, interface_name, | 84 registry_.BindInterface(source_info, interface_name, |
82 std::move(interface_pipe)); | 85 std::move(interface_pipe)); |
83 } | 86 } |
84 | 87 |
(...skipping 20 matching lines...) Expand all Loading... |
105 | 108 |
106 void TouchHudApplication::Create( | 109 void TouchHudApplication::Create( |
107 const service_manager::BindSourceInfo& source_info, | 110 const service_manager::BindSourceInfo& source_info, |
108 mash::mojom::LaunchableRequest request) { | 111 mash::mojom::LaunchableRequest request) { |
109 binding_.Close(); | 112 binding_.Close(); |
110 binding_.Bind(std::move(request)); | 113 binding_.Bind(std::move(request)); |
111 } | 114 } |
112 | 115 |
113 } // namespace touch_hud | 116 } // namespace touch_hud |
114 } // namespace ash | 117 } // namespace ash |
OLD | NEW |