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_ = views::AuraInit::Create( |
73 context()->connector(), context()->identity(), "views_mus_resources.pak", | 73 context()->connector(), context()->identity(), "views_mus_resources.pak", |
74 std::string(), nullptr, views::AuraInit::Mode::AURA_MUS); | 74 std::string(), nullptr, views::AuraInit::Mode::AURA_MUS); |
| 75 if (!aura_init_) |
| 76 context()->QuitNow(); |
75 } | 77 } |
76 | 78 |
77 void TouchHudApplication::OnBindInterface( | 79 void TouchHudApplication::OnBindInterface( |
78 const service_manager::BindSourceInfo& source_info, | 80 const service_manager::BindSourceInfo& source_info, |
79 const std::string& interface_name, | 81 const std::string& interface_name, |
80 mojo::ScopedMessagePipeHandle interface_pipe) { | 82 mojo::ScopedMessagePipeHandle interface_pipe) { |
81 registry_.BindInterface(source_info, interface_name, | 83 registry_.BindInterface(source_info, interface_name, |
82 std::move(interface_pipe)); | 84 std::move(interface_pipe)); |
83 } | 85 } |
84 | 86 |
(...skipping 20 matching lines...) Expand all Loading... |
105 | 107 |
106 void TouchHudApplication::Create( | 108 void TouchHudApplication::Create( |
107 const service_manager::BindSourceInfo& source_info, | 109 const service_manager::BindSourceInfo& source_info, |
108 mash::mojom::LaunchableRequest request) { | 110 mash::mojom::LaunchableRequest request) { |
109 binding_.Close(); | 111 binding_.Close(); |
110 binding_.Bind(std::move(request)); | 112 binding_.Bind(std::move(request)); |
111 } | 113 } |
112 | 114 |
113 } // namespace touch_hud | 115 } // namespace touch_hud |
114 } // namespace ash | 116 } // namespace ash |
OLD | NEW |