| 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/login_status.h" | 9 #include "ash/login_status.h" |
| 10 #include "ash/session/session_controller.h" | 10 #include "ash/session/session_controller.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 } | 33 } |
| 34 | 34 |
| 35 void TestSystemTrayDelegate::SetAvailableIMEList(const IMEInfoList& list) { | 35 void TestSystemTrayDelegate::SetAvailableIMEList(const IMEInfoList& list) { |
| 36 ime_list_ = list; | 36 ime_list_ = list; |
| 37 } | 37 } |
| 38 | 38 |
| 39 LoginStatus TestSystemTrayDelegate::GetUserLoginStatus() const { | 39 LoginStatus TestSystemTrayDelegate::GetUserLoginStatus() const { |
| 40 return Shell::Get()->session_controller()->login_status(); | 40 return Shell::Get()->session_controller()->login_status(); |
| 41 } | 41 } |
| 42 | 42 |
| 43 std::string TestSystemTrayDelegate::GetSupervisedUserManager() const { | |
| 44 if (!Shell::Get()->session_controller()->IsUserSupervised()) | |
| 45 return std::string(); | |
| 46 return "manager@chrome.com"; | |
| 47 } | |
| 48 | |
| 49 bool TestSystemTrayDelegate::GetSessionStartTime( | 43 bool TestSystemTrayDelegate::GetSessionStartTime( |
| 50 base::TimeTicks* session_start_time) { | 44 base::TimeTicks* session_start_time) { |
| 51 // Just returns TimeTicks::Now(), so the remaining time is always the | 45 // Just returns TimeTicks::Now(), so the remaining time is always the |
| 52 // specified limit. This is useful for testing. | 46 // specified limit. This is useful for testing. |
| 53 if (session_length_limit_set_) | 47 if (session_length_limit_set_) |
| 54 *session_start_time = base::TimeTicks::Now(); | 48 *session_start_time = base::TimeTicks::Now(); |
| 55 return session_length_limit_set_; | 49 return session_length_limit_set_; |
| 56 } | 50 } |
| 57 | 51 |
| 58 bool TestSystemTrayDelegate::GetSessionLengthLimit( | 52 bool TestSystemTrayDelegate::GetSessionLengthLimit( |
| 59 base::TimeDelta* session_length_limit) { | 53 base::TimeDelta* session_length_limit) { |
| 60 if (session_length_limit_set_) | 54 if (session_length_limit_set_) |
| 61 *session_length_limit = session_length_limit_; | 55 *session_length_limit = session_length_limit_; |
| 62 return session_length_limit_set_; | 56 return session_length_limit_set_; |
| 63 } | 57 } |
| 64 | 58 |
| 65 void TestSystemTrayDelegate::GetCurrentIME(IMEInfo* info) { | 59 void TestSystemTrayDelegate::GetCurrentIME(IMEInfo* info) { |
| 66 *info = current_ime_; | 60 *info = current_ime_; |
| 67 } | 61 } |
| 68 | 62 |
| 69 void TestSystemTrayDelegate::GetAvailableIMEList(IMEInfoList* list) { | 63 void TestSystemTrayDelegate::GetAvailableIMEList(IMEInfoList* list) { |
| 70 *list = ime_list_; | 64 *list = ime_list_; |
| 71 } | 65 } |
| 72 | 66 |
| 73 } // namespace test | 67 } // namespace test |
| 74 } // namespace ash | 68 } // namespace ash |
| OLD | NEW |