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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 ObserverList<UserManager::UserSessionStateObserver> | 363 ObserverList<UserManager::UserSessionStateObserver> |
363 session_state_observer_list_; | 364 session_state_observer_list_; |
364 | 365 |
365 // Time at which this object was created. | 366 // Time at which this object was created. |
366 base::TimeTicks manager_creation_time_; | 367 base::TimeTicks manager_creation_time_; |
367 | 368 |
368 // ID of the user just added to the session that needs to be activated | 369 // ID of the user just added to the session that needs to be activated |
369 // as soon as user's profile is loaded. | 370 // as soon as user's profile is loaded. |
370 std::string pending_user_switch_; | 371 std::string pending_user_switch_; |
371 | 372 |
| 373 // ID of the user that was active in the previous session. |
| 374 // Preference value is stored here before first user signs in |
| 375 // because pref will be overidden once session restore starts. |
| 376 std::string last_session_active_user_; |
| 377 bool last_session_active_user_initialized_; |
| 378 |
372 // TaskRunner for UI thread. | 379 // TaskRunner for UI thread. |
373 scoped_refptr<base::TaskRunner> task_runner_; | 380 scoped_refptr<base::TaskRunner> task_runner_; |
374 | 381 |
375 // TaskRunner for SequencedWorkerPool. | 382 // TaskRunner for SequencedWorkerPool. |
376 scoped_refptr<base::TaskRunner> blocking_task_runner_; | 383 scoped_refptr<base::TaskRunner> blocking_task_runner_; |
377 | 384 |
378 base::WeakPtrFactory<UserManagerBase> weak_factory_; | 385 base::WeakPtrFactory<UserManagerBase> weak_factory_; |
379 | 386 |
380 DISALLOW_COPY_AND_ASSIGN(UserManagerBase); | 387 DISALLOW_COPY_AND_ASSIGN(UserManagerBase); |
381 }; | 388 }; |
382 | 389 |
383 } // namespace user_manager | 390 } // namespace user_manager |
384 | 391 |
385 #endif // COMPONENTS_USER_MANAGER_USER_MANAGER_BASE_H_ | 392 #endif // COMPONENTS_USER_MANAGER_USER_MANAGER_BASE_H_ |
OLD | NEW |