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_USER_MANAGER_USER_MANAGER_BASE_H_ | 5 #ifndef COMPONENTS_USER_MANAGER_USER_MANAGER_BASE_H_ |
6 #define COMPONENTS_USER_MANAGER_USER_MANAGER_BASE_H_ | 6 #define COMPONENTS_USER_MANAGER_USER_MANAGER_BASE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // UserManager implementation: | 45 // UserManager implementation: |
46 virtual void Shutdown() OVERRIDE; | 46 virtual void Shutdown() OVERRIDE; |
47 virtual const UserList& GetUsers() const OVERRIDE; | 47 virtual const UserList& GetUsers() const OVERRIDE; |
48 virtual const UserList& GetLoggedInUsers() const OVERRIDE; | 48 virtual const UserList& GetLoggedInUsers() const OVERRIDE; |
49 virtual const UserList& GetLRULoggedInUsers() const OVERRIDE; | 49 virtual const UserList& GetLRULoggedInUsers() const OVERRIDE; |
50 virtual const std::string& GetOwnerEmail() const OVERRIDE; | 50 virtual const std::string& GetOwnerEmail() const OVERRIDE; |
51 virtual void UserLoggedIn(const std::string& user_id, | 51 virtual void UserLoggedIn(const std::string& user_id, |
52 const std::string& user_id_hash, | 52 const std::string& user_id_hash, |
53 bool browser_restart) OVERRIDE; | 53 bool browser_restart) OVERRIDE; |
54 virtual void SwitchActiveUser(const std::string& user_id) OVERRIDE; | 54 virtual void SwitchActiveUser(const std::string& user_id) OVERRIDE; |
| 55 virtual void SwitchToLastActiveUser() OVERRIDE; |
55 virtual void SessionStarted() OVERRIDE; | 56 virtual void SessionStarted() OVERRIDE; |
56 virtual void RemoveUser(const std::string& user_id, | 57 virtual void RemoveUser(const std::string& user_id, |
57 RemoveUserDelegate* delegate) OVERRIDE; | 58 RemoveUserDelegate* delegate) OVERRIDE; |
58 virtual void RemoveUserFromList(const std::string& user_id) OVERRIDE; | 59 virtual void RemoveUserFromList(const std::string& user_id) OVERRIDE; |
59 virtual bool IsKnownUser(const std::string& user_id) const OVERRIDE; | 60 virtual bool IsKnownUser(const std::string& user_id) const OVERRIDE; |
60 virtual const User* FindUser(const std::string& user_id) const OVERRIDE; | 61 virtual const User* FindUser(const std::string& user_id) const OVERRIDE; |
61 virtual User* FindUserAndModify(const std::string& user_id) OVERRIDE; | 62 virtual User* FindUserAndModify(const std::string& user_id) OVERRIDE; |
62 virtual const User* GetLoggedInUser() const OVERRIDE; | 63 virtual const User* GetLoggedInUser() const OVERRIDE; |
63 virtual User* GetLoggedInUser() OVERRIDE; | 64 virtual User* GetLoggedInUser() OVERRIDE; |
64 virtual const User* GetActiveUser() const OVERRIDE; | 65 virtual const User* GetActiveUser() const OVERRIDE; |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 ObserverList<UserManager::UserSessionStateObserver> | 362 ObserverList<UserManager::UserSessionStateObserver> |
362 session_state_observer_list_; | 363 session_state_observer_list_; |
363 | 364 |
364 // Time at which this object was created. | 365 // Time at which this object was created. |
365 base::TimeTicks manager_creation_time_; | 366 base::TimeTicks manager_creation_time_; |
366 | 367 |
367 // ID of the user just added to the session that needs to be activated | 368 // ID of the user just added to the session that needs to be activated |
368 // as soon as user's profile is loaded. | 369 // as soon as user's profile is loaded. |
369 std::string pending_user_switch_; | 370 std::string pending_user_switch_; |
370 | 371 |
| 372 // ID of the user that was active in the previous session. |
| 373 // Preference value is stored here before first user signs in |
| 374 // because pref will be overidden once session restore starts. |
| 375 std::string last_session_active_user_; |
| 376 bool last_session_active_user_initialized_; |
| 377 |
371 // TaskRunner for UI thread. | 378 // TaskRunner for UI thread. |
372 scoped_refptr<base::TaskRunner> task_runner_; | 379 scoped_refptr<base::TaskRunner> task_runner_; |
373 | 380 |
374 // TaskRunner for SequencedWorkerPool. | 381 // TaskRunner for SequencedWorkerPool. |
375 scoped_refptr<base::TaskRunner> blocking_task_runner_; | 382 scoped_refptr<base::TaskRunner> blocking_task_runner_; |
376 | 383 |
377 base::WeakPtrFactory<UserManagerBase> weak_factory_; | 384 base::WeakPtrFactory<UserManagerBase> weak_factory_; |
378 | 385 |
379 DISALLOW_COPY_AND_ASSIGN(UserManagerBase); | 386 DISALLOW_COPY_AND_ASSIGN(UserManagerBase); |
380 }; | 387 }; |
381 | 388 |
382 } // namespace user_manager | 389 } // namespace user_manager |
383 | 390 |
384 #endif // COMPONENTS_USER_MANAGER_USER_MANAGER_BASE_H_ | 391 #endif // COMPONENTS_USER_MANAGER_USER_MANAGER_BASE_H_ |
OLD | NEW |