| 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/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" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 namespace test { | 23 namespace test { |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 bool g_system_update_required = false; | 27 bool g_system_update_required = false; |
| 28 LoginStatus g_initial_status = LoginStatus::USER; | 28 LoginStatus g_initial_status = LoginStatus::USER; |
| 29 | 29 |
| 30 } // namespace | 30 } // namespace |
| 31 | 31 |
| 32 TestSystemTrayDelegate::TestSystemTrayDelegate() | 32 TestSystemTrayDelegate::TestSystemTrayDelegate() |
| 33 : should_show_display_notification_(false), | 33 : login_status_(g_initial_status), session_length_limit_set_(false) {} |
| 34 login_status_(g_initial_status), | |
| 35 session_length_limit_set_(false) {} | |
| 36 | 34 |
| 37 TestSystemTrayDelegate::~TestSystemTrayDelegate() {} | 35 TestSystemTrayDelegate::~TestSystemTrayDelegate() {} |
| 38 | 36 |
| 39 // static | 37 // static |
| 40 void TestSystemTrayDelegate::SetInitialLoginStatus(LoginStatus login_status) { | 38 void TestSystemTrayDelegate::SetInitialLoginStatus(LoginStatus login_status) { |
| 41 g_initial_status = login_status; | 39 g_initial_status = login_status; |
| 42 } | 40 } |
| 43 | 41 |
| 44 // static | 42 // static |
| 45 void TestSystemTrayDelegate::SetSystemUpdateRequired(bool required) { | 43 void TestSystemTrayDelegate::SetSystemUpdateRequired(bool required) { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 return login_status_ == LoginStatus::SUPERVISED; | 89 return login_status_ == LoginStatus::SUPERVISED; |
| 92 } | 90 } |
| 93 | 91 |
| 94 void TestSystemTrayDelegate::GetSystemUpdateInfo(UpdateInfo* info) const { | 92 void TestSystemTrayDelegate::GetSystemUpdateInfo(UpdateInfo* info) const { |
| 95 DCHECK(info); | 93 DCHECK(info); |
| 96 info->severity = UpdateInfo::UPDATE_NONE; | 94 info->severity = UpdateInfo::UPDATE_NONE; |
| 97 info->update_required = g_system_update_required; | 95 info->update_required = g_system_update_required; |
| 98 info->factory_reset_required = false; | 96 info->factory_reset_required = false; |
| 99 } | 97 } |
| 100 | 98 |
| 101 bool TestSystemTrayDelegate::ShouldShowDisplayNotification() { | |
| 102 return should_show_display_notification_; | |
| 103 } | |
| 104 | |
| 105 bool TestSystemTrayDelegate::GetSessionStartTime( | 99 bool TestSystemTrayDelegate::GetSessionStartTime( |
| 106 base::TimeTicks* session_start_time) { | 100 base::TimeTicks* session_start_time) { |
| 107 // Just returns TimeTicks::Now(), so the remaining time is always the | 101 // Just returns TimeTicks::Now(), so the remaining time is always the |
| 108 // specified limit. This is useful for testing. | 102 // specified limit. This is useful for testing. |
| 109 if (session_length_limit_set_) | 103 if (session_length_limit_set_) |
| 110 *session_start_time = base::TimeTicks::Now(); | 104 *session_start_time = base::TimeTicks::Now(); |
| 111 return session_length_limit_set_; | 105 return session_length_limit_set_; |
| 112 } | 106 } |
| 113 | 107 |
| 114 bool TestSystemTrayDelegate::GetSessionLengthLimit( | 108 bool TestSystemTrayDelegate::GetSessionLengthLimit( |
| (...skipping 19 matching lines...) Expand all Loading... |
| 134 void TestSystemTrayDelegate::GetCurrentIME(IMEInfo* info) { | 128 void TestSystemTrayDelegate::GetCurrentIME(IMEInfo* info) { |
| 135 *info = current_ime_; | 129 *info = current_ime_; |
| 136 } | 130 } |
| 137 | 131 |
| 138 void TestSystemTrayDelegate::GetAvailableIMEList(IMEInfoList* list) { | 132 void TestSystemTrayDelegate::GetAvailableIMEList(IMEInfoList* list) { |
| 139 *list = ime_list_; | 133 *list = ime_list_; |
| 140 } | 134 } |
| 141 | 135 |
| 142 } // namespace test | 136 } // namespace test |
| 143 } // namespace ash | 137 } // namespace ash |
| OLD | NEW |