| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 void TestSystemTrayDelegate::SetSessionLengthLimitForTest( | 56 void TestSystemTrayDelegate::SetSessionLengthLimitForTest( |
| 57 const base::TimeDelta& new_limit) { | 57 const base::TimeDelta& new_limit) { |
| 58 session_length_limit_ = new_limit; | 58 session_length_limit_ = new_limit; |
| 59 session_length_limit_set_ = true; | 59 session_length_limit_set_ = true; |
| 60 } | 60 } |
| 61 | 61 |
| 62 void TestSystemTrayDelegate::ClearSessionLengthLimit() { | 62 void TestSystemTrayDelegate::ClearSessionLengthLimit() { |
| 63 session_length_limit_set_ = false; | 63 session_length_limit_set_ = false; |
| 64 } | 64 } |
| 65 | 65 |
| 66 void TestSystemTrayDelegate::SetCurrentIME(const IMEInfo& info) { |
| 67 current_ime_ = info; |
| 68 } |
| 69 |
| 66 LoginStatus TestSystemTrayDelegate::GetUserLoginStatus() const { | 70 LoginStatus TestSystemTrayDelegate::GetUserLoginStatus() const { |
| 67 // Initial login status has been changed for testing. | 71 // Initial login status has been changed for testing. |
| 68 if (g_initial_status != LoginStatus::USER && | 72 if (g_initial_status != LoginStatus::USER && |
| 69 g_initial_status == login_status_) { | 73 g_initial_status == login_status_) { |
| 70 return login_status_; | 74 return login_status_; |
| 71 } | 75 } |
| 72 | 76 |
| 73 // At new user image screen manager->IsUserLoggedIn() would return true | 77 // At new user image screen manager->IsUserLoggedIn() would return true |
| 74 // but there's no browser session available yet so use SessionStarted(). | 78 // but there's no browser session available yet so use SessionStarted(). |
| 75 SessionStateDelegate* delegate = WmShell::Get()->GetSessionStateDelegate(); | 79 SessionStateDelegate* delegate = WmShell::Get()->GetSessionStateDelegate(); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 131 |
| 128 std::unique_ptr<SystemTrayItem> | 132 std::unique_ptr<SystemTrayItem> |
| 129 TestSystemTrayDelegate::CreateRotationLockTrayItem(SystemTray* tray) { | 133 TestSystemTrayDelegate::CreateRotationLockTrayItem(SystemTray* tray) { |
| 130 #if defined(OS_CHROMEOS) | 134 #if defined(OS_CHROMEOS) |
| 131 return base::MakeUnique<TrayRotationLock>(tray); | 135 return base::MakeUnique<TrayRotationLock>(tray); |
| 132 #else | 136 #else |
| 133 return nullptr; | 137 return nullptr; |
| 134 #endif | 138 #endif |
| 135 } | 139 } |
| 136 | 140 |
| 141 void TestSystemTrayDelegate::GetCurrentIME(IMEInfo* info) { |
| 142 *info = current_ime_; |
| 143 } |
| 144 |
| 137 } // namespace test | 145 } // namespace test |
| 138 } // namespace ash | 146 } // namespace ash |
| OLD | NEW |