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

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

Issue 2558043006: ash: Use system tray mojo interface to show system update tray icon (Closed)
Patch Set: fix gcc Created 4 years 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
« no previous file with comments | « ash/common/test/test_system_tray_delegate.h ('k') | ash/public/interfaces/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/common/test/test_system_tray_delegate.h" 5 #include "ash/common/test/test_system_tray_delegate.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "ash/common/login_status.h" 9 #include "ash/common/login_status.h"
10 #include "ash/common/session/session_state_delegate.h" 10 #include "ash/common/session/session_state_delegate.h"
11 #include "ash/common/wm_shell.h" 11 #include "ash/common/wm_shell.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 13
14 namespace ash { 14 namespace ash {
15 namespace test { 15 namespace test {
16 16
17 namespace { 17 namespace {
18 18
19 bool g_system_update_required = false;
20 LoginStatus g_initial_status = LoginStatus::USER; 19 LoginStatus g_initial_status = LoginStatus::USER;
21 20
22 } // namespace 21 } // namespace
23 22
24 TestSystemTrayDelegate::TestSystemTrayDelegate() 23 TestSystemTrayDelegate::TestSystemTrayDelegate()
25 : login_status_(g_initial_status), session_length_limit_set_(false) {} 24 : login_status_(g_initial_status), session_length_limit_set_(false) {}
26 25
27 TestSystemTrayDelegate::~TestSystemTrayDelegate() {} 26 TestSystemTrayDelegate::~TestSystemTrayDelegate() {}
28 27
29 void TestSystemTrayDelegate::SetLoginStatus(LoginStatus login_status) { 28 void TestSystemTrayDelegate::SetLoginStatus(LoginStatus login_status) {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 return LoginStatus::NOT_LOGGED_IN; 63 return LoginStatus::NOT_LOGGED_IN;
65 if (delegate->IsScreenLocked()) 64 if (delegate->IsScreenLocked())
66 return LoginStatus::LOCKED; 65 return LoginStatus::LOCKED;
67 return login_status_; 66 return login_status_;
68 } 67 }
69 68
70 bool TestSystemTrayDelegate::IsUserSupervised() const { 69 bool TestSystemTrayDelegate::IsUserSupervised() const {
71 return login_status_ == LoginStatus::SUPERVISED; 70 return login_status_ == LoginStatus::SUPERVISED;
72 } 71 }
73 72
74 void TestSystemTrayDelegate::GetSystemUpdateInfo(UpdateInfo* info) const {
75 DCHECK(info);
76 info->severity = UpdateInfo::UPDATE_NONE;
77 info->update_required = g_system_update_required;
78 info->factory_reset_required = false;
79 }
80
81 bool TestSystemTrayDelegate::GetSessionStartTime( 73 bool TestSystemTrayDelegate::GetSessionStartTime(
82 base::TimeTicks* session_start_time) { 74 base::TimeTicks* session_start_time) {
83 // Just returns TimeTicks::Now(), so the remaining time is always the 75 // Just returns TimeTicks::Now(), so the remaining time is always the
84 // specified limit. This is useful for testing. 76 // specified limit. This is useful for testing.
85 if (session_length_limit_set_) 77 if (session_length_limit_set_)
86 *session_start_time = base::TimeTicks::Now(); 78 *session_start_time = base::TimeTicks::Now();
87 return session_length_limit_set_; 79 return session_length_limit_set_;
88 } 80 }
89 81
90 bool TestSystemTrayDelegate::GetSessionLengthLimit( 82 bool TestSystemTrayDelegate::GetSessionLengthLimit(
(...skipping 17 matching lines...) Expand all
108 : old_status_(g_initial_status) { 100 : old_status_(g_initial_status) {
109 g_initial_status = new_status; 101 g_initial_status = new_status;
110 } 102 }
111 103
112 ScopedInitialLoginStatus::~ScopedInitialLoginStatus() { 104 ScopedInitialLoginStatus::~ScopedInitialLoginStatus() {
113 g_initial_status = old_status_; 105 g_initial_status = old_status_;
114 } 106 }
115 107
116 } // namespace test 108 } // namespace test
117 } // namespace ash 109 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/test/test_system_tray_delegate.h ('k') | ash/public/interfaces/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698