Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #include "ash/session_state_delegate_stub.h" | 5 #include "ash/session_state_delegate_stub.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell/example_factory.h" | 8 #include "ash/shell/example_factory.h" |
| 9 #include "ash/shell_delegate.h" | 9 #include "ash/shell_delegate.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 62 | 62 |
| 63 void SessionStateDelegateStub::UnlockScreen() { | 63 void SessionStateDelegateStub::UnlockScreen() { |
| 64 screen_locked_ = false; | 64 screen_locked_ = false; |
| 65 Shell::GetInstance()->UpdateShelfVisibility(); | 65 Shell::GetInstance()->UpdateShelfVisibility(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 bool SessionStateDelegateStub::IsUserSessionBlocked() const { | 68 bool SessionStateDelegateStub::IsUserSessionBlocked() const { |
| 69 return !IsActiveUserSessionStarted() || IsScreenLocked(); | 69 return !IsActiveUserSessionStarted() || IsScreenLocked(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 SessionStateDelegate::SessionState SessionStateDelegateStub::GetSessionState() | |
| 73 const { | |
| 74 if (IsScreenLocked()) | |
| 75 return STATE_LOCK; | |
| 76 | |
| 77 // Assuming that if session is not active we're at login. | |
|
Daniel Erat
2014/04/10 16:30:32
nit: s/Assuming/Assume/
Nikita (slow)
2014/04/10 17:22:51
Done.
| |
| 78 return IsActiveUserSessionStarted() ? STATE_SESSION : STATE_LOGIN_PRIMARY; | |
| 79 } | |
| 80 | |
| 72 const base::string16 SessionStateDelegateStub::GetUserDisplayName( | 81 const base::string16 SessionStateDelegateStub::GetUserDisplayName( |
| 73 MultiProfileIndex index) const { | 82 MultiProfileIndex index) const { |
| 74 return base::UTF8ToUTF16("stub-user"); | 83 return base::UTF8ToUTF16("stub-user"); |
| 75 } | 84 } |
| 76 | 85 |
| 77 const std::string SessionStateDelegateStub::GetUserEmail( | 86 const std::string SessionStateDelegateStub::GetUserEmail( |
| 78 MultiProfileIndex index) const { | 87 MultiProfileIndex index) const { |
| 79 return "stub-user@domain.com"; | 88 return "stub-user@domain.com"; |
| 80 } | 89 } |
| 81 | 90 |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 101 | 110 |
| 102 void SessionStateDelegateStub::AddSessionStateObserver( | 111 void SessionStateDelegateStub::AddSessionStateObserver( |
| 103 ash::SessionStateObserver* observer) { | 112 ash::SessionStateObserver* observer) { |
| 104 } | 113 } |
| 105 | 114 |
| 106 void SessionStateDelegateStub::RemoveSessionStateObserver( | 115 void SessionStateDelegateStub::RemoveSessionStateObserver( |
| 107 ash::SessionStateObserver* observer) { | 116 ash::SessionStateObserver* observer) { |
| 108 } | 117 } |
| 109 | 118 |
| 110 } // namespace ash | 119 } // namespace ash |
| OLD | NEW |