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 "mash/init/init.h" | 5 #include "mash/init/init.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/guid.h" | 9 #include "base/guid.h" |
10 #include "mash/login/public/interfaces/login.mojom.h" | 10 #include "mash/login/public/interfaces/login.mojom.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 user_services_[user_id] = std::move(connection); | 43 user_services_[user_id] = std::move(connection); |
44 } | 44 } |
45 } | 45 } |
46 | 46 |
47 void Init::StopServicesForUser(const mojo::String& user_id) { | 47 void Init::StopServicesForUser(const mojo::String& user_id) { |
48 auto it = user_services_.find(user_id); | 48 auto it = user_services_.find(user_id); |
49 if (it != user_services_.end()) | 49 if (it != user_services_.end()) |
50 user_services_.erase(it); | 50 user_services_.erase(it); |
51 } | 51 } |
52 | 52 |
53 void Init::Create(shell::Connection* connection, mojom::InitRequest request) { | 53 void Init::Create(const shell::Identity& remote_identity, |
| 54 mojom::InitRequest request) { |
54 init_bindings_.AddBinding(this, std::move(request)); | 55 init_bindings_.AddBinding(this, std::move(request)); |
55 } | 56 } |
56 | 57 |
57 void Init::UserServiceQuit(const std::string& user_id) { | 58 void Init::UserServiceQuit(const std::string& user_id) { |
58 auto it = user_services_.find(user_id); | 59 auto it = user_services_.find(user_id); |
59 DCHECK(it != user_services_.end()); | 60 DCHECK(it != user_services_.end()); |
60 user_services_.erase(it); | 61 user_services_.erase(it); |
61 } | 62 } |
62 | 63 |
63 void Init::StartTracing() { | 64 void Init::StartTracing() { |
64 connector_->Connect("mojo:tracing"); | 65 connector_->Connect("mojo:tracing"); |
65 } | 66 } |
66 | 67 |
67 void Init::StartLogin() { | 68 void Init::StartLogin() { |
68 login_connection_ = connector_->Connect("mojo:login"); | 69 login_connection_ = connector_->Connect("mojo:login"); |
69 login_connection_->AddInterface<mojom::Init>(this); | 70 login_connection_->AddInterface<mojom::Init>(this); |
70 mash::login::mojom::LoginPtr login; | 71 mash::login::mojom::LoginPtr login; |
71 login_connection_->GetInterface(&login); | 72 login_connection_->GetInterface(&login); |
72 login->ShowLoginUI(); | 73 login->ShowLoginUI(); |
73 } | 74 } |
74 | 75 |
75 } // namespace init | 76 } // namespace init |
76 } // namespace main | 77 } // namespace main |
OLD | NEW |