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

Side by Side Diff: ash/session_state_delegate.h

Issue 231123002: Notify about major session changes events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tests Created 6 years, 8 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
« no previous file with comments | « no previous file | ash/session_state_delegate_stub.h » ('j') | ash/session_state_delegate_stub.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_STATE_DELEGATE_H_ 5 #ifndef ASH_SESSION_STATE_DELEGATE_H_
6 #define ASH_SESSION_STATE_DELEGATE_H_ 6 #define ASH_SESSION_STATE_DELEGATE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 27 matching lines...) Expand all
38 // TODO(oshima): Replace MultiProfileIndex with BrowsreContext, bacause 38 // TODO(oshima): Replace MultiProfileIndex with BrowsreContext, bacause
39 // GetUserXXX are useful for non multi profile scenario in ash_shell. 39 // GetUserXXX are useful for non multi profile scenario in ash_shell.
40 class ASH_EXPORT SessionStateDelegate { 40 class ASH_EXPORT SessionStateDelegate {
41 public: 41 public:
42 // Defines the cycle direction for |CycleActiveUser|. 42 // Defines the cycle direction for |CycleActiveUser|.
43 enum CycleUser { 43 enum CycleUser {
44 CYCLE_TO_NEXT_USER = 0, // Cycle to the next user. 44 CYCLE_TO_NEXT_USER = 0, // Cycle to the next user.
45 CYCLE_TO_PREVIOUS_USER, // Cycle to the previous user. 45 CYCLE_TO_PREVIOUS_USER, // Cycle to the previous user.
46 }; 46 };
47 47
48 // Defines session state i.e. whether session is running or not and
49 // whether user session is blocked by things like lock screen and
50 // multi-profile login.
51 enum SessionState {
52 STATE_UNKNOWN = 0,
Daniel Erat 2014/04/10 16:30:32 please don't add an "unknown" state; this means th
Nikita (slow) 2014/04/10 17:22:51 Done.
53
54 // When primary user login UI is shown i.e. after boot or sign out,
55 // no active user session exists yet.
56 STATE_LOGIN_PRIMARY,
57
58 // Inside user session, no blocking UI (login/lock) is shown.
59 STATE_SESSION,
60
61 // User session is active, currently is locked.
62 STATE_LOCK,
stevenjb 2014/04/10 17:00:06 I'm not sure I understand this state. If this is s
Nikita (slow) 2014/04/10 17:22:51 Done.
63
64 // When secondary user login UI is shown i.e. other users are
65 // already logged in and is currently adding another user to the session.
66 STATE_LOGIN_SECONDARY,
stevenjb 2014/04/10 17:00:06 While I hate to second guess a change in an area I
Nikita (slow) 2014/04/10 17:22:51 I've dropped STATE_LOCK for now. I would prefer t
Nikita (slow) 2014/04/10 17:29:27 Since adding this logic to ShellObserver::OnLoginS
stevenjb 2014/04/10 17:47:55 I agree. That's another one where we conflate "Log
67 };
68
48 virtual ~SessionStateDelegate() {}; 69 virtual ~SessionStateDelegate() {};
49 70
50 // Returns the browser context for the user given by |index|. 71 // Returns the browser context for the user given by |index|.
51 virtual content::BrowserContext* GetBrowserContextByIndex( 72 virtual content::BrowserContext* GetBrowserContextByIndex(
52 MultiProfileIndex index) = 0; 73 MultiProfileIndex index) = 0;
53 74
54 // Returns the browser context associated with the window. 75 // Returns the browser context associated with the window.
55 virtual content::BrowserContext* GetBrowserContextForWindow( 76 virtual content::BrowserContext* GetBrowserContextForWindow(
56 aura::Window* window) = 0; 77 aura::Window* window) = 0;
57 78
(...skipping 24 matching lines...) Expand all
82 virtual void LockScreen() = 0; 103 virtual void LockScreen() = 0;
83 104
84 // Unlocks the screen. 105 // Unlocks the screen.
85 virtual void UnlockScreen() = 0; 106 virtual void UnlockScreen() = 0;
86 107
87 // Returns |true| if user session blocked by some overlying UI. It can be 108 // Returns |true| if user session blocked by some overlying UI. It can be
88 // login screen, lock screen or screen for adding users into multi-profile 109 // login screen, lock screen or screen for adding users into multi-profile
89 // session. 110 // session.
90 virtual bool IsUserSessionBlocked() const = 0; 111 virtual bool IsUserSessionBlocked() const = 0;
91 112
113 // Returns current session state.
114 virtual SessionState GetSessionState() const = 0;
115
92 // Gets the displayed name for the user with the given |index|. 116 // Gets the displayed name for the user with the given |index|.
93 // Note that |index| can at maximum be |NumberOfLoggedInUsers() - 1|. 117 // Note that |index| can at maximum be |NumberOfLoggedInUsers() - 1|.
94 virtual const base::string16 GetUserDisplayName( 118 virtual const base::string16 GetUserDisplayName(
95 MultiProfileIndex index) const = 0; 119 MultiProfileIndex index) const = 0;
96 120
97 // Gets the display email address for the user with the given |index|. 121 // Gets the display email address for the user with the given |index|.
98 // The display email address might contains some periods in the email name 122 // The display email address might contains some periods in the email name
99 // as well as capitalized letters. For example: "Foo.Bar@mock.com". 123 // as well as capitalized letters. For example: "Foo.Bar@mock.com".
100 // Note that |index| can at maximum be |NumberOfLoggedInUsers() - 1|. 124 // Note that |index| can at maximum be |NumberOfLoggedInUsers() - 1|.
101 virtual const std::string GetUserEmail(MultiProfileIndex index) const = 0; 125 virtual const std::string GetUserEmail(MultiProfileIndex index) const = 0;
(...skipping 19 matching lines...) Expand all
121 virtual void CycleActiveUser(CycleUser cycle_user) = 0; 145 virtual void CycleActiveUser(CycleUser cycle_user) = 0;
122 146
123 // Adds or removes sessions state observer. 147 // Adds or removes sessions state observer.
124 virtual void AddSessionStateObserver(SessionStateObserver* observer) = 0; 148 virtual void AddSessionStateObserver(SessionStateObserver* observer) = 0;
125 virtual void RemoveSessionStateObserver(SessionStateObserver* observer) = 0; 149 virtual void RemoveSessionStateObserver(SessionStateObserver* observer) = 0;
126 }; 150 };
127 151
128 } // namespace ash 152 } // namespace ash
129 153
130 #endif // ASH_SESSION_STATE_DELEGATE_H_ 154 #endif // ASH_SESSION_STATE_DELEGATE_H_
OLDNEW
« no previous file with comments | « no previous file | ash/session_state_delegate_stub.h » ('j') | ash/session_state_delegate_stub.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698