| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_SESSION_MANAGER_CORE_SESSION_MANAGER_H_ | 5 #ifndef COMPONENTS_SESSION_MANAGER_CORE_SESSION_MANAGER_H_ |
| 6 #define COMPONENTS_SESSION_MANAGER_CORE_SESSION_MANAGER_H_ | 6 #define COMPONENTS_SESSION_MANAGER_CORE_SESSION_MANAGER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "components/session_manager/session_manager_export.h" | 11 #include "components/session_manager/session_manager_export.h" |
| 12 #include "components/session_manager/session_manager_types.h" |
| 12 | 13 |
| 13 namespace session_manager { | 14 namespace session_manager { |
| 14 | 15 |
| 15 class SessionManagerDelegate; | 16 class SessionManagerDelegate; |
| 16 | 17 |
| 17 // TODO(nkostylev): Get rid/consolidate with: | |
| 18 // ash::SessionStateDelegate::SessionState and chromeos::LoggedInState. | |
| 19 enum SessionState { | |
| 20 // Default value, when session state hasn't been initialized yet. | |
| 21 SESSION_STATE_UNKNOWN = 0, | |
| 22 | |
| 23 // Running out of box UI. | |
| 24 SESSION_STATE_OOBE, | |
| 25 | |
| 26 // Running login UI (primary user) but user sign in hasn't completed yet. | |
| 27 SESSION_STATE_LOGIN_PRIMARY, | |
| 28 | |
| 29 // Running login UI (primary or secondary user), user sign in has been | |
| 30 // completed but login UI hasn't been hidden yet. This means that either | |
| 31 // some session initialization is happening or user has to go through some | |
| 32 // UI flow on the same login UI like select avatar, agree to terms of | |
| 33 // service etc. | |
| 34 SESSION_STATE_LOGGED_IN_NOT_ACTIVE, | |
| 35 | |
| 36 // A user(s) has logged in *and* login UI is hidden i.e. user session is | |
| 37 // not blocked. | |
| 38 SESSION_STATE_ACTIVE, | |
| 39 | |
| 40 // Same as SESSION_STATE_LOGIN_PRIMARY but for multi-profiles sign in i.e. | |
| 41 // when there's at least one user already active in the session. | |
| 42 SESSION_STATE_LOGIN_SECONDARY, | |
| 43 }; | |
| 44 | |
| 45 class SESSION_EXPORT SessionManager { | 18 class SESSION_EXPORT SessionManager { |
| 46 public: | 19 public: |
| 47 SessionManager(); | 20 SessionManager(); |
| 48 virtual ~SessionManager(); | 21 virtual ~SessionManager(); |
| 49 | 22 |
| 50 // Returns current SessionManager instance and NULL if it hasn't been | 23 // Returns current SessionManager instance and NULL if it hasn't been |
| 51 // initialized yet. | 24 // initialized yet. |
| 52 static SessionManager* Get(); | 25 static SessionManager* Get(); |
| 53 | 26 |
| 54 SessionState session_state() const { return session_state_; } | 27 SessionState session_state() const { return session_state_; } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 protected: | 66 protected: |
| 94 session_manager::SessionManager* session_manager_; | 67 session_manager::SessionManager* session_manager_; |
| 95 | 68 |
| 96 private: | 69 private: |
| 97 DISALLOW_COPY_AND_ASSIGN(SessionManagerDelegate); | 70 DISALLOW_COPY_AND_ASSIGN(SessionManagerDelegate); |
| 98 }; | 71 }; |
| 99 | 72 |
| 100 } // namespace session_manager | 73 } // namespace session_manager |
| 101 | 74 |
| 102 #endif // COMPONENTS_SESSION_MANAGER_CORE_SESSION_MANAGER_H_ | 75 #endif // COMPONENTS_SESSION_MANAGER_CORE_SESSION_MANAGER_H_ |
| OLD | NEW |