OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/test/test_system_tray_delegate.h" | 5 #include "ash/test/test_system_tray_delegate.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "ash/session/session_state_delegate.h" | 9 #include "ash/session/session_state_delegate.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 11 #include "ash/system/user/login_status.h" |
11 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
12 #include "base/time/time.h" | 13 #include "base/time/time.h" |
13 | 14 |
14 namespace ash { | 15 namespace ash { |
15 namespace test { | 16 namespace test { |
16 | 17 |
17 namespace { | 18 namespace { |
18 | 19 |
19 user::LoginStatus g_initial_status = user::LOGGED_IN_USER; | 20 user::LoginStatus g_initial_status = user::LOGGED_IN_USER; |
20 | 21 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 SessionStateDelegate* delegate = | 63 SessionStateDelegate* delegate = |
63 Shell::GetInstance()->session_state_delegate(); | 64 Shell::GetInstance()->session_state_delegate(); |
64 | 65 |
65 if (!delegate->IsActiveUserSessionStarted()) | 66 if (!delegate->IsActiveUserSessionStarted()) |
66 return ash::user::LOGGED_IN_NONE; | 67 return ash::user::LOGGED_IN_NONE; |
67 if (delegate->IsScreenLocked()) | 68 if (delegate->IsScreenLocked()) |
68 return user::LOGGED_IN_LOCKED; | 69 return user::LOGGED_IN_LOCKED; |
69 return login_status_; | 70 return login_status_; |
70 } | 71 } |
71 | 72 |
| 73 bool TestSystemTrayDelegate::IsUserSupervised() const { |
| 74 return login_status_ == ash::user::LOGGED_IN_SUPERVISED; |
| 75 } |
| 76 |
72 bool TestSystemTrayDelegate::ShouldShowDisplayNotification() { | 77 bool TestSystemTrayDelegate::ShouldShowDisplayNotification() { |
73 return should_show_display_notification_; | 78 return should_show_display_notification_; |
74 } | 79 } |
75 | 80 |
76 bool TestSystemTrayDelegate::GetSessionStartTime( | 81 bool TestSystemTrayDelegate::GetSessionStartTime( |
77 base::TimeTicks* session_start_time) { | 82 base::TimeTicks* session_start_time) { |
78 // Just returns TimeTicks::Now(), so the remaining time is always the | 83 // Just returns TimeTicks::Now(), so the remaining time is always the |
79 // specified limit. This is useful for testing. | 84 // specified limit. This is useful for testing. |
80 if (session_length_limit_set_) | 85 if (session_length_limit_set_) |
81 *session_start_time = base::TimeTicks::Now(); | 86 *session_start_time = base::TimeTicks::Now(); |
(...skipping 10 matching lines...) Expand all Loading... |
92 void TestSystemTrayDelegate::ShutDown() { | 97 void TestSystemTrayDelegate::ShutDown() { |
93 base::MessageLoop::current()->Quit(); | 98 base::MessageLoop::current()->Quit(); |
94 } | 99 } |
95 | 100 |
96 void TestSystemTrayDelegate::SignOut() { | 101 void TestSystemTrayDelegate::SignOut() { |
97 base::MessageLoop::current()->Quit(); | 102 base::MessageLoop::current()->Quit(); |
98 } | 103 } |
99 | 104 |
100 } // namespace test | 105 } // namespace test |
101 } // namespace ash | 106 } // namespace ash |
OLD | NEW |