| 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/login/login.h" | 5 #include "mash/login/login.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/public/cpp/shell_window_ids.h" | 10 #include "ash/public/cpp/shell_window_ids.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 139 |
| 140 void LoginAs(const std::string& user_id) { | 140 void LoginAs(const std::string& user_id) { |
| 141 user_access_manager_->SetActiveUser(user_id); | 141 user_access_manager_->SetActiveUser(user_id); |
| 142 mash::init::mojom::InitPtr init; | 142 mash::init::mojom::InitPtr init; |
| 143 connector()->ConnectToInterface("service:mash_init", &init); | 143 connector()->ConnectToInterface("service:mash_init", &init); |
| 144 init->StartService("service:mash_session", user_id); | 144 init->StartService("service:mash_session", user_id); |
| 145 } | 145 } |
| 146 | 146 |
| 147 private: | 147 private: |
| 148 // service_manager::Service: | 148 // service_manager::Service: |
| 149 void OnStart(const service_manager::Identity& identity) override { | 149 void OnStart(const service_manager::ServiceInfo& info) override { |
| 150 identity_ = identity; | 150 identity_ = info.identity; |
| 151 tracing_.Initialize(connector(), identity.name()); | 151 tracing_.Initialize(connector(), identity_.name()); |
| 152 | 152 |
| 153 aura_init_.reset( | 153 aura_init_.reset( |
| 154 new views::AuraInit(connector(), "views_mus_resources.pak")); | 154 new views::AuraInit(connector(), "views_mus_resources.pak")); |
| 155 | 155 |
| 156 connector()->ConnectToInterface("service:ui", &user_access_manager_); | 156 connector()->ConnectToInterface("service:ui", &user_access_manager_); |
| 157 user_access_manager_->SetActiveUser(identity.user_id()); | 157 user_access_manager_->SetActiveUser(identity_.user_id()); |
| 158 } | 158 } |
| 159 bool OnConnect(const service_manager::Identity& remote_identity, | 159 bool OnConnect(const service_manager::ServiceInfo& remote_info, |
| 160 service_manager::InterfaceRegistry* registry) override { | 160 service_manager::InterfaceRegistry* registry) override { |
| 161 registry->AddInterface<mojom::Login>(this); | 161 registry->AddInterface<mojom::Login>(this); |
| 162 return true; | 162 return true; |
| 163 } | 163 } |
| 164 | 164 |
| 165 // service_manager::InterfaceFactory<mojom::Login>: | 165 // service_manager::InterfaceFactory<mojom::Login>: |
| 166 void Create(const service_manager::Identity& remote_identity, | 166 void Create(const service_manager::Identity& remote_identity, |
| 167 mojom::LoginRequest request) override { | 167 mojom::LoginRequest request) override { |
| 168 bindings_.AddBinding(this, std::move(request)); | 168 bindings_.AddBinding(this, std::move(request)); |
| 169 } | 169 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 200 } | 200 } |
| 201 | 201 |
| 202 } // namespace | 202 } // namespace |
| 203 | 203 |
| 204 service_manager::Service* CreateLogin() { | 204 service_manager::Service* CreateLogin() { |
| 205 return new Login; | 205 return new Login; |
| 206 } | 206 } |
| 207 | 207 |
| 208 } // namespace login | 208 } // namespace login |
| 209 } // namespace main | 209 } // namespace main |
| OLD | NEW |