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

Side by Side Diff: ash/session/session_state_observer.h

Issue 1165323004: We should use UserID object to identify users instead of username. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 ASH_SESSION_SESSION_STATE_OBSERVER_H_ 5 #ifndef ASH_SESSION_SESSION_STATE_OBSERVER_H_
6 #define ASH_SESSION_SESSION_STATE_OBSERVER_H_ 6 #define ASH_SESSION_SESSION_STATE_OBSERVER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
11 #include "ash/session/session_state_delegate.h" 11 #include "ash/session/session_state_delegate.h"
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 13
14 namespace user_manager {
15 class UserID;
16 }
17
14 namespace ash { 18 namespace ash {
15 19
16 class ASH_EXPORT SessionStateObserver { 20 class ASH_EXPORT SessionStateObserver {
17 public: 21 public:
18 // Called when active user has changed. 22 // Called when active user has changed.
19 virtual void ActiveUserChanged(const std::string& user_id) {} 23 virtual void ActiveUserChanged(const user_manager::UserID& user_id) {}
20 24
21 // Called when another user gets added to the existing session. 25 // Called when another user gets added to the existing session.
22 virtual void UserAddedToSession(const std::string& user_id) {} 26 virtual void UserAddedToSession(const user_manager::UserID& user_id) {}
23 27
24 // Called when session state is changed. 28 // Called when session state is changed.
25 virtual void SessionStateChanged(SessionStateDelegate::SessionState state) {} 29 virtual void SessionStateChanged(SessionStateDelegate::SessionState state) {}
26 30
27 protected: 31 protected:
28 virtual ~SessionStateObserver() {} 32 virtual ~SessionStateObserver() {}
29 }; 33 };
30 34
31 // A class to attach / detach an object as a session state observer with a 35 // A class to attach / detach an object as a session state observer with a
32 // scoped pointer. 36 // scoped pointer.
33 class ASH_EXPORT ScopedSessionStateObserver { 37 class ASH_EXPORT ScopedSessionStateObserver {
34 public: 38 public:
35 explicit ScopedSessionStateObserver(ash::SessionStateObserver* observer); 39 explicit ScopedSessionStateObserver(ash::SessionStateObserver* observer);
36 virtual ~ScopedSessionStateObserver(); 40 virtual ~ScopedSessionStateObserver();
37 41
38 private: 42 private:
39 ash::SessionStateObserver* observer_; 43 ash::SessionStateObserver* observer_;
40 44
41 DISALLOW_COPY_AND_ASSIGN(ScopedSessionStateObserver); 45 DISALLOW_COPY_AND_ASSIGN(ScopedSessionStateObserver);
42 }; 46 };
43 47
44 } // namespace ash 48 } // namespace ash
45 49
46 #endif // ASH_SESSION_SESSION_STATE_OBSERVER_H_ 50 #endif // ASH_SESSION_SESSION_STATE_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698