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

Side by Side Diff: ash/test/test_system_tray_delegate.cc

Issue 575653002: Revert of ash: Add checks for supervised users. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 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"
12 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
13 #include "base/time/time.h" 12 #include "base/time/time.h"
14 13
15 namespace ash { 14 namespace ash {
16 namespace test { 15 namespace test {
17 16
18 namespace { 17 namespace {
19 18
20 user::LoginStatus g_initial_status = user::LOGGED_IN_USER; 19 user::LoginStatus g_initial_status = user::LOGGED_IN_USER;
21 20
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 SessionStateDelegate* delegate = 62 SessionStateDelegate* delegate =
64 Shell::GetInstance()->session_state_delegate(); 63 Shell::GetInstance()->session_state_delegate();
65 64
66 if (!delegate->IsActiveUserSessionStarted()) 65 if (!delegate->IsActiveUserSessionStarted())
67 return ash::user::LOGGED_IN_NONE; 66 return ash::user::LOGGED_IN_NONE;
68 if (delegate->IsScreenLocked()) 67 if (delegate->IsScreenLocked())
69 return user::LOGGED_IN_LOCKED; 68 return user::LOGGED_IN_LOCKED;
70 return login_status_; 69 return login_status_;
71 } 70 }
72 71
73 bool TestSystemTrayDelegate::IsUserSupervised() const {
74 return login_status_ == ash::user::LOGGED_IN_SUPERVISED;
75 }
76
77 bool TestSystemTrayDelegate::ShouldShowDisplayNotification() { 72 bool TestSystemTrayDelegate::ShouldShowDisplayNotification() {
78 return should_show_display_notification_; 73 return should_show_display_notification_;
79 } 74 }
80 75
81 bool TestSystemTrayDelegate::GetSessionStartTime( 76 bool TestSystemTrayDelegate::GetSessionStartTime(
82 base::TimeTicks* session_start_time) { 77 base::TimeTicks* session_start_time) {
83 // Just returns TimeTicks::Now(), so the remaining time is always the 78 // Just returns TimeTicks::Now(), so the remaining time is always the
84 // specified limit. This is useful for testing. 79 // specified limit. This is useful for testing.
85 if (session_length_limit_set_) 80 if (session_length_limit_set_)
86 *session_start_time = base::TimeTicks::Now(); 81 *session_start_time = base::TimeTicks::Now();
(...skipping 10 matching lines...) Expand all
97 void TestSystemTrayDelegate::ShutDown() { 92 void TestSystemTrayDelegate::ShutDown() {
98 base::MessageLoop::current()->Quit(); 93 base::MessageLoop::current()->Quit();
99 } 94 }
100 95
101 void TestSystemTrayDelegate::SignOut() { 96 void TestSystemTrayDelegate::SignOut() {
102 base::MessageLoop::current()->Quit(); 97 base::MessageLoop::current()->Quit();
103 } 98 }
104 99
105 } // namespace test 100 } // namespace test
106 } // namespace ash 101 } // namespace ash
OLDNEW
« no previous file with comments | « ash/test/test_system_tray_delegate.h ('k') | chrome/browser/ui/ash/system_tray_delegate_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698