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 "base/macros.h" | 7 #include "base/macros.h" |
8 #include "mash/login/ui.h" | 8 #include "mash/login/ui.h" |
9 #include "mojo/public/cpp/bindings/strong_binding.h" | 9 #include "mojo/public/cpp/bindings/strong_binding.h" |
10 #include "mojo/shell/public/cpp/connector.h" | 10 #include "mojo/shell/public/cpp/connector.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 controller_(controller), | 25 controller_(controller), |
26 user_id_(user_id), | 26 user_id_(user_id), |
27 binding_(this, std::move(request)) {} | 27 binding_(this, std::move(request)) {} |
28 ~Login() override {} | 28 ~Login() override {} |
29 | 29 |
30 private: | 30 private: |
31 // mojom::Login: | 31 // mojom::Login: |
32 void ShowLoginUI() override { | 32 void ShowLoginUI() override { |
33 UI::Show(connector_, controller_); | 33 UI::Show(connector_, controller_); |
34 } | 34 } |
35 void Logout() override { | |
36 controller_->init()->StopServicesForUser(user_id_); | |
37 UI::Show(connector_, controller_); | |
38 } | |
39 void SwitchUser() override { | 35 void SwitchUser() override { |
40 UI::Show(connector_, controller_); | 36 UI::Show(connector_, controller_); |
41 } | 37 } |
42 | 38 |
43 mojo::Connector* connector_; | 39 mojo::Connector* connector_; |
44 LoginController* controller_; | 40 LoginController* controller_; |
45 const std::string user_id_; | 41 const std::string user_id_; |
46 mojo::StrongBinding<mojom::Login> binding_; | 42 mojo::StrongBinding<mojom::Login> binding_; |
47 | 43 |
48 DISALLOW_COPY_AND_ASSIGN(Login); | 44 DISALLOW_COPY_AND_ASSIGN(Login); |
(...skipping 22 matching lines...) Expand all Loading... |
71 } | 67 } |
72 | 68 |
73 void LoginController::Create(mojo::Connection* connection, | 69 void LoginController::Create(mojo::Connection* connection, |
74 mojom::LoginRequest request) { | 70 mojom::LoginRequest request) { |
75 new Login(connector_, this, connection->GetRemoteIdentity().user_id(), | 71 new Login(connector_, this, connection->GetRemoteIdentity().user_id(), |
76 std::move(request)); | 72 std::move(request)); |
77 } | 73 } |
78 | 74 |
79 } // namespace login | 75 } // namespace login |
80 } // namespace main | 76 } // namespace main |
OLD | NEW |