Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Side by Side Diff: chrome/browser/chromeos/login/user_manager.h

Issue 15718003: Add SessionStateObserver with ActiveUserChanged() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge & add SessionStateDelegateChromeos Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "chrome/browser/chromeos/login/user.h" 10 #include "chrome/browser/chromeos/login/user.h"
(...skipping 28 matching lines...) Expand all
39 // Called when the local state preferences is changed. 39 // Called when the local state preferences is changed.
40 virtual void LocalStateChanged(UserManager* user_manager) = 0; 40 virtual void LocalStateChanged(UserManager* user_manager) = 0;
41 41
42 // Called when merge session state is changed. 42 // Called when merge session state is changed.
43 virtual void MergeSessionStateChanged(MergeSessionState state) {} 43 virtual void MergeSessionStateChanged(MergeSessionState state) {}
44 44
45 protected: 45 protected:
46 virtual ~Observer(); 46 virtual ~Observer();
47 }; 47 };
48 48
49 // TODO(nkostylev): Merge with session state refactoring CL. 49 // TODO(nkostylev): Refactor and move this observer out of UserManager.
50 // Observer interface that defines methods used to notify on user session /
51 // active user state changes. Default implementation is empty.
50 class UserSessionStateObserver { 52 class UserSessionStateObserver {
51 public: 53 public:
54 // Called when active user has changed.
55 virtual void ActiveUserChanged(const User* active_user);
56
52 // Called right before notifying on user change so that those who rely 57 // Called right before notifying on user change so that those who rely
53 // on user_id hash would be accessing up-to-date value. 58 // on user_id hash would be accessing up-to-date value.
54 virtual void ActiveUserHashChanged(const std::string& hash) = 0; 59 virtual void ActiveUserHashChanged(const std::string& hash);
55 60
56 // Called when UserManager finishes restoring user sessions after crash. 61 // Called when UserManager finishes restoring user sessions after crash.
57 virtual void PendingUserSessionsRestoreFinished() = 0; 62 virtual void PendingUserSessionsRestoreFinished();
58 63
59 protected: 64 protected:
60 virtual ~UserSessionStateObserver(); 65 virtual ~UserSessionStateObserver();
61 }; 66 };
62 67
63 // Username for stub login when not running on ChromeOS. 68 // Username for stub login when not running on ChromeOS.
64 static const char kStubUser[]; 69 static const char kStubUser[];
65 70
66 // Magic e-mail addresses are bad. They exist here because some code already 71 // Magic e-mail addresses are bad. They exist here because some code already
67 // depends on them and it is hard to figure out what. Any user types added in 72 // depends on them and it is hard to figure out what. Any user types added in
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 ScopedTestUserManager(); 380 ScopedTestUserManager();
376 ~ScopedTestUserManager(); 381 ~ScopedTestUserManager();
377 382
378 private: 383 private:
379 DISALLOW_COPY_AND_ASSIGN(ScopedTestUserManager); 384 DISALLOW_COPY_AND_ASSIGN(ScopedTestUserManager);
380 }; 385 };
381 386
382 } // namespace chromeos 387 } // namespace chromeos
383 388
384 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ 389 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/crash_restore_browsertest.cc ('k') | chrome/browser/chromeos/login/user_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698