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

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

Issue 1806203002: Kill login after logging in. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@56cascade
Patch Set: . Created 4 years, 9 months 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.h ('k') | mash/init/manifest.json » ('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/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 10 matching lines...) Expand all
21 void Init::Initialize(mojo::Connector* connector, 21 void Init::Initialize(mojo::Connector* connector,
22 const mojo::Identity& identity, 22 const mojo::Identity& identity,
23 uint32_t id) { 23 uint32_t id) {
24 connector_ = connector; 24 connector_ = connector;
25 connector_->Connect("mojo:mus"); 25 connector_->Connect("mojo:mus");
26 StartTracing(); 26 StartTracing();
27 StartResourceProvider(); 27 StartResourceProvider();
28 StartLogin(); 28 StartLogin();
29 } 29 }
30 30
31 bool Init::AcceptConnection(mojo::Connection* connection) {
32 connection->AddInterface<mojom::Init>(this);
33 return true;
34 }
35
31 void Init::StartService(const mojo::String& name, 36 void Init::StartService(const mojo::String& name,
32 const mojo::String& user_id) { 37 const mojo::String& user_id) {
33 if (user_services_.find(user_id) == user_services_.end()) { 38 if (user_services_.find(user_id) == user_services_.end()) {
34 mojo::Connector::ConnectParams params(mojo::Identity(name, user_id)); 39 mojo::Connector::ConnectParams params(mojo::Identity(name, user_id));
35 scoped_ptr<mojo::Connection> connection = connector_->Connect(&params); 40 scoped_ptr<mojo::Connection> connection = connector_->Connect(&params);
36 connection->SetConnectionLostClosure( 41 connection->SetConnectionLostClosure(
37 base::Bind(&Init::UserServiceQuit, base::Unretained(this), user_id)); 42 base::Bind(&Init::UserServiceQuit, base::Unretained(this), user_id));
38 user_services_[user_id] = std::move(connection); 43 user_services_[user_id] = std::move(connection);
39 } 44 }
40 } 45 }
(...skipping 18 matching lines...) Expand all
59 connector_->Connect("mojo:tracing"); 64 connector_->Connect("mojo:tracing");
60 } 65 }
61 66
62 void Init::StartResourceProvider() { 67 void Init::StartResourceProvider() {
63 connector_->Connect("mojo:resource_provider"); 68 connector_->Connect("mojo:resource_provider");
64 } 69 }
65 70
66 void Init::StartLogin() { 71 void Init::StartLogin() {
67 login_connection_ = connector_->Connect("mojo:login"); 72 login_connection_ = connector_->Connect("mojo:login");
68 login_connection_->AddInterface<mojom::Init>(this); 73 login_connection_->AddInterface<mojom::Init>(this);
69 login_connection_->SetConnectionLostClosure(
70 base::Bind(&Init::StartLogin, base::Unretained(this)));
71 mash::login::mojom::LoginPtr login; 74 mash::login::mojom::LoginPtr login;
72 login_connection_->GetInterface(&login); 75 login_connection_->GetInterface(&login);
73 login->ShowLoginUI(); 76 login->ShowLoginUI();
74 } 77 }
75 78
76 } // namespace init 79 } // namespace init
77 } // namespace main 80 } // namespace main
OLDNEW
« no previous file with comments | « mash/init/init.h ('k') | mash/init/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698