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