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

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

Issue 2568413002: Revert of ash: Use system tray mojo interface to show system update tray icon (Closed)
Patch Set: 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;
19 LoginStatus g_initial_status = LoginStatus::USER; 20 LoginStatus g_initial_status = LoginStatus::USER;
20 21
21 } // namespace 22 } // namespace
22 23
23 TestSystemTrayDelegate::TestSystemTrayDelegate() 24 TestSystemTrayDelegate::TestSystemTrayDelegate()
24 : login_status_(g_initial_status), session_length_limit_set_(false) {} 25 : login_status_(g_initial_status), session_length_limit_set_(false) {}
25 26
26 TestSystemTrayDelegate::~TestSystemTrayDelegate() {} 27 TestSystemTrayDelegate::~TestSystemTrayDelegate() {}
27 28
28 void TestSystemTrayDelegate::SetLoginStatus(LoginStatus login_status) { 29 void TestSystemTrayDelegate::SetLoginStatus(LoginStatus login_status) {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 return LoginStatus::NOT_LOGGED_IN; 64 return LoginStatus::NOT_LOGGED_IN;
64 if (delegate->IsScreenLocked()) 65 if (delegate->IsScreenLocked())
65 return LoginStatus::LOCKED; 66 return LoginStatus::LOCKED;
66 return login_status_; 67 return login_status_;
67 } 68 }
68 69
69 bool TestSystemTrayDelegate::IsUserSupervised() const { 70 bool TestSystemTrayDelegate::IsUserSupervised() const {
70 return login_status_ == LoginStatus::SUPERVISED; 71 return login_status_ == LoginStatus::SUPERVISED;
71 } 72 }
72 73
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
73 bool TestSystemTrayDelegate::GetSessionStartTime( 81 bool TestSystemTrayDelegate::GetSessionStartTime(
74 base::TimeTicks* session_start_time) { 82 base::TimeTicks* session_start_time) {
75 // Just returns TimeTicks::Now(), so the remaining time is always the 83 // Just returns TimeTicks::Now(), so the remaining time is always the
76 // specified limit. This is useful for testing. 84 // specified limit. This is useful for testing.
77 if (session_length_limit_set_) 85 if (session_length_limit_set_)
78 *session_start_time = base::TimeTicks::Now(); 86 *session_start_time = base::TimeTicks::Now();
79 return session_length_limit_set_; 87 return session_length_limit_set_;
80 } 88 }
81 89
82 bool TestSystemTrayDelegate::GetSessionLengthLimit( 90 bool TestSystemTrayDelegate::GetSessionLengthLimit(
(...skipping 17 matching lines...) Expand all
100 : old_status_(g_initial_status) { 108 : old_status_(g_initial_status) {
101 g_initial_status = new_status; 109 g_initial_status = new_status;
102 } 110 }
103 111
104 ScopedInitialLoginStatus::~ScopedInitialLoginStatus() { 112 ScopedInitialLoginStatus::~ScopedInitialLoginStatus() {
105 g_initial_status = old_status_; 113 g_initial_status = old_status_;
106 } 114 }
107 115
108 } // namespace test 116 } // namespace test
109 } // namespace ash 117 } // 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