| 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 #ifndef MASH_LOGIN_LOGIN_H_ | 5 #ifndef MASH_LOGIN_LOGIN_H_ |
| 6 #define MASH_LOGIN_LOGIN_H_ | 6 #define MASH_LOGIN_LOGIN_H_ |
| 7 | 7 |
| 8 #include <map> | 8 namespace mojo { |
| 9 | 9 class ShellClient; |
| 10 #include "base/macros.h" | |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "mash/init/public/interfaces/init.mojom.h" | |
| 13 #include "mash/login/public/interfaces/login.mojom.h" | |
| 14 #include "mojo/services/tracing/public/cpp/tracing_impl.h" | |
| 15 #include "mojo/shell/public/cpp/shell_client.h" | |
| 16 | |
| 17 namespace views { | |
| 18 class AuraInit; | |
| 19 } | 10 } |
| 20 | 11 |
| 21 namespace mash { | 12 namespace mash { |
| 22 namespace login { | 13 namespace login { |
| 23 | 14 |
| 24 class LoginController : public mojo::ShellClient, | 15 mojo::ShellClient* CreateLogin(); |
| 25 public mojo::InterfaceFactory<mojom::Login> { | |
| 26 public: | |
| 27 LoginController(); | |
| 28 ~LoginController() override; | |
| 29 | |
| 30 init::mojom::Init* init() { return init_.get(); } | |
| 31 const std::string& login_user_id() const { return login_user_id_; } | |
| 32 | |
| 33 private: | |
| 34 // mojo::ShellClient: | |
| 35 void Initialize(mojo::Connector* connector, const mojo::Identity& identity, | |
| 36 uint32_t id) override; | |
| 37 bool AcceptConnection(mojo::Connection* connection) override; | |
| 38 | |
| 39 // mojo::InterfaceFactory<mojom::Login>: | |
| 40 void Create(mojo::Connection* connection, | |
| 41 mojom::LoginRequest request) override; | |
| 42 | |
| 43 mojo::Connector* connector_; | |
| 44 std::string login_user_id_; | |
| 45 mojo::TracingImpl tracing_; | |
| 46 scoped_ptr<views::AuraInit> aura_init_; | |
| 47 init::mojom::InitPtr init_; | |
| 48 | |
| 49 DISALLOW_COPY_AND_ASSIGN(LoginController); | |
| 50 }; | |
| 51 | 16 |
| 52 } // namespace login | 17 } // namespace login |
| 53 } // namespace mash | 18 } // namespace mash |
| 54 | 19 |
| 55 #endif // MASH_LOGIN_LOGIN_H_ | 20 #endif // MASH_LOGIN_LOGIN_H_ |
| OLD | NEW |