| 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/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" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 LoginStatus g_initial_status = LoginStatus::USER; | 21 LoginStatus g_initial_status = LoginStatus::USER; |
| 22 | 22 |
| 23 } // namespace | 23 } // namespace |
| 24 | 24 |
| 25 TestSystemTrayDelegate::TestSystemTrayDelegate() | 25 TestSystemTrayDelegate::TestSystemTrayDelegate() |
| 26 : login_status_(g_initial_status), session_length_limit_set_(false) {} | 26 : login_status_(g_initial_status), session_length_limit_set_(false) {} |
| 27 | 27 |
| 28 TestSystemTrayDelegate::~TestSystemTrayDelegate() {} | 28 TestSystemTrayDelegate::~TestSystemTrayDelegate() {} |
| 29 | 29 |
| 30 // static | 30 // static |
| 31 void TestSystemTrayDelegate::SetInitialLoginStatus(LoginStatus login_status) { | |
| 32 g_initial_status = login_status; | |
| 33 } | |
| 34 | |
| 35 // static | |
| 36 void TestSystemTrayDelegate::SetSystemUpdateRequired(bool required) { | 31 void TestSystemTrayDelegate::SetSystemUpdateRequired(bool required) { |
| 37 g_system_update_required = required; | 32 g_system_update_required = required; |
| 38 } | 33 } |
| 39 | 34 |
| 40 void TestSystemTrayDelegate::SetLoginStatus(LoginStatus login_status) { | 35 void TestSystemTrayDelegate::SetLoginStatus(LoginStatus login_status) { |
| 41 login_status_ = login_status; | 36 login_status_ = login_status; |
| 42 WmShell::Get()->UpdateAfterLoginStatusChange(login_status); | 37 WmShell::Get()->UpdateAfterLoginStatusChange(login_status); |
| 43 } | 38 } |
| 44 | 39 |
| 45 void TestSystemTrayDelegate::SetSessionLengthLimitForTest( | 40 void TestSystemTrayDelegate::SetSessionLengthLimitForTest( |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 } | 105 } |
| 111 | 106 |
| 112 void TestSystemTrayDelegate::GetCurrentIME(IMEInfo* info) { | 107 void TestSystemTrayDelegate::GetCurrentIME(IMEInfo* info) { |
| 113 *info = current_ime_; | 108 *info = current_ime_; |
| 114 } | 109 } |
| 115 | 110 |
| 116 void TestSystemTrayDelegate::GetAvailableIMEList(IMEInfoList* list) { | 111 void TestSystemTrayDelegate::GetAvailableIMEList(IMEInfoList* list) { |
| 117 *list = ime_list_; | 112 *list = ime_list_; |
| 118 } | 113 } |
| 119 | 114 |
| 115 //////////////////////////////////////////////////////////////////////////////// |
| 116 |
| 117 ScopedInitialLoginStatus::ScopedInitialLoginStatus(LoginStatus new_status) |
| 118 : old_status_(g_initial_status) { |
| 119 g_initial_status = new_status; |
| 120 } |
| 121 |
| 122 ScopedInitialLoginStatus::~ScopedInitialLoginStatus() { |
| 123 g_initial_status = old_status_; |
| 124 } |
| 125 |
| 120 } // namespace test | 126 } // namespace test |
| 121 } // namespace ash | 127 } // namespace ash |
| OLD | NEW |