Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Side by Side Diff: mash/login/login.cc

Issue 2435153004: Change Service contract to pass ServiceInfo instead of Identity (Closed)
Patch Set: . Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mash/init/init.cc ('k') | mash/package/mash_packaged_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « mash/init/init.cc ('k') | mash/package/mash_packaged_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698