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

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

Issue 561713002: ash: Add checks for supervised users. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Log changed. 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 "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 13
Denis Kuznetsov (DE-MUC) 2014/09/15 11:33:36 No need for empty line here.
14 #include "components/user_manager/user.h"
15 #include "components/user_manager/user_manager.h"
16
14 namespace ash { 17 namespace ash {
15 namespace test { 18 namespace test {
16 19
17 namespace { 20 namespace {
18 21
19 user::LoginStatus g_initial_status = user::LOGGED_IN_USER; 22 user::LoginStatus g_initial_status = user::LOGGED_IN_USER;
20 23
21 } // namespace 24 } // namespace
22 25
23 TestSystemTrayDelegate::TestSystemTrayDelegate() 26 TestSystemTrayDelegate::TestSystemTrayDelegate()
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 SessionStateDelegate* delegate = 65 SessionStateDelegate* delegate =
63 Shell::GetInstance()->session_state_delegate(); 66 Shell::GetInstance()->session_state_delegate();
64 67
65 if (!delegate->IsActiveUserSessionStarted()) 68 if (!delegate->IsActiveUserSessionStarted())
66 return ash::user::LOGGED_IN_NONE; 69 return ash::user::LOGGED_IN_NONE;
67 if (delegate->IsScreenLocked()) 70 if (delegate->IsScreenLocked())
68 return user::LOGGED_IN_LOCKED; 71 return user::LOGGED_IN_LOCKED;
69 return login_status_; 72 return login_status_;
70 } 73 }
71 74
75 bool TestSystemTrayDelegate::IsUserSupervised() const {
76 user_manager::User* user = user_manager::UserManager::Get()->GetActiveUser();
77 return user && user->IsSupervised();
78 }
79
72 bool TestSystemTrayDelegate::ShouldShowDisplayNotification() { 80 bool TestSystemTrayDelegate::ShouldShowDisplayNotification() {
73 return should_show_display_notification_; 81 return should_show_display_notification_;
74 } 82 }
75 83
76 bool TestSystemTrayDelegate::GetSessionStartTime( 84 bool TestSystemTrayDelegate::GetSessionStartTime(
77 base::TimeTicks* session_start_time) { 85 base::TimeTicks* session_start_time) {
78 // Just returns TimeTicks::Now(), so the remaining time is always the 86 // Just returns TimeTicks::Now(), so the remaining time is always the
79 // specified limit. This is useful for testing. 87 // specified limit. This is useful for testing.
80 if (session_length_limit_set_) 88 if (session_length_limit_set_)
81 *session_start_time = base::TimeTicks::Now(); 89 *session_start_time = base::TimeTicks::Now();
(...skipping 10 matching lines...) Expand all
92 void TestSystemTrayDelegate::ShutDown() { 100 void TestSystemTrayDelegate::ShutDown() {
93 base::MessageLoop::current()->Quit(); 101 base::MessageLoop::current()->Quit();
94 } 102 }
95 103
96 void TestSystemTrayDelegate::SignOut() { 104 void TestSystemTrayDelegate::SignOut() {
97 base::MessageLoop::current()->Quit(); 105 base::MessageLoop::current()->Quit();
98 } 106 }
99 107
100 } // namespace test 108 } // namespace test
101 } // namespace ash 109 } // 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