| 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 #ifndef ASH_TEST_TEST_SYSTEM_TRAY_DELEGATE_H_ | 5 #ifndef ASH_TEST_TEST_SYSTEM_TRAY_DELEGATE_H_ |
| 6 #define ASH_TEST_TEST_SYSTEM_TRAY_DELEGATE_H_ | 6 #define ASH_TEST_TEST_SYSTEM_TRAY_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "ash/system/tray/ime_info.h" | 8 #include "ash/system/tray/ime_info.h" |
| 9 #include "ash/system/tray/system_tray_delegate.h" | 9 #include "ash/system/tray/system_tray_delegate.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 // Sets the IME info. | 35 // Sets the IME info. |
| 36 void SetCurrentIME(const IMEInfo& info); | 36 void SetCurrentIME(const IMEInfo& info); |
| 37 | 37 |
| 38 // Sets the list of available IMEs. | 38 // Sets the list of available IMEs. |
| 39 void SetAvailableIMEList(const IMEInfoList& list); | 39 void SetAvailableIMEList(const IMEInfoList& list); |
| 40 | 40 |
| 41 // SystemTrayDelegate: | 41 // SystemTrayDelegate: |
| 42 LoginStatus GetUserLoginStatus() const override; | 42 LoginStatus GetUserLoginStatus() const override; |
| 43 std::string GetSupervisedUserManager() const override; | 43 std::string GetSupervisedUserManager() const override; |
| 44 bool IsUserSupervised() const override; | |
| 45 bool GetSessionStartTime(base::TimeTicks* session_start_time) override; | 44 bool GetSessionStartTime(base::TimeTicks* session_start_time) override; |
| 46 bool GetSessionLengthLimit(base::TimeDelta* session_length_limit) override; | 45 bool GetSessionLengthLimit(base::TimeDelta* session_length_limit) override; |
| 47 void GetCurrentIME(IMEInfo* info) override; | 46 void GetCurrentIME(IMEInfo* info) override; |
| 48 void GetAvailableIMEList(IMEInfoList* list) override; | 47 void GetAvailableIMEList(IMEInfoList* list) override; |
| 49 | 48 |
| 50 private: | 49 private: |
| 51 LoginStatus login_status_; | 50 LoginStatus login_status_; |
| 52 base::TimeDelta session_length_limit_; | 51 base::TimeDelta session_length_limit_; |
| 53 bool session_length_limit_set_; | 52 bool session_length_limit_set_; |
| 54 IMEInfo current_ime_; | 53 IMEInfo current_ime_; |
| 55 IMEInfoList ime_list_; | 54 IMEInfoList ime_list_; |
| 56 | 55 |
| 57 DISALLOW_COPY_AND_ASSIGN(TestSystemTrayDelegate); | 56 DISALLOW_COPY_AND_ASSIGN(TestSystemTrayDelegate); |
| 58 }; | 57 }; |
| 59 | 58 |
| 60 // Changes the initial login status before TestSystemTrayDelegate is created. | |
| 61 // Allows testing the case when chrome is restarted right after login (such as | |
| 62 // when a flag is set). | |
| 63 class ScopedInitialLoginStatus { | |
| 64 public: | |
| 65 explicit ScopedInitialLoginStatus(LoginStatus status); | |
| 66 ~ScopedInitialLoginStatus(); | |
| 67 | |
| 68 private: | |
| 69 LoginStatus old_status_; | |
| 70 | |
| 71 DISALLOW_COPY_AND_ASSIGN(ScopedInitialLoginStatus); | |
| 72 }; | |
| 73 | |
| 74 } // namespace test | 59 } // namespace test |
| 75 } // namespace ash | 60 } // namespace ash |
| 76 | 61 |
| 77 #endif // ASH_TEST_TEST_SYSTEM_TRAY_DELEGATE_H_ | 62 #endif // ASH_TEST_TEST_SYSTEM_TRAY_DELEGATE_H_ |
| OLD | NEW |