| 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_COMMON_TEST_TEST_SYSTEM_TRAY_DELEGATE_H_ | 5 #ifndef ASH_COMMON_TEST_TEST_SYSTEM_TRAY_DELEGATE_H_ |
| 6 #define ASH_COMMON_TEST_TEST_SYSTEM_TRAY_DELEGATE_H_ | 6 #define ASH_COMMON_TEST_TEST_SYSTEM_TRAY_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "ash/common/system/tray/default_system_tray_delegate.h" | 8 #include "ash/common/system/tray/default_system_tray_delegate.h" |
| 9 #include "ash/common/system/tray/ime_info.h" | 9 #include "ash/common/system/tray/ime_info.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // don't need to care its lifecycle. | 30 // don't need to care its lifecycle. |
| 31 static void SetInitialLoginStatus(LoginStatus login_status); | 31 static void SetInitialLoginStatus(LoginStatus login_status); |
| 32 | 32 |
| 33 // Changes the current login status in the test. This also invokes | 33 // Changes the current login status in the test. This also invokes |
| 34 // UpdateAfterLoginStatusChange(). Usually this is called in the test code to | 34 // UpdateAfterLoginStatusChange(). Usually this is called in the test code to |
| 35 // set up a login status. This will fit to most of the test cases, but this | 35 // set up a login status. This will fit to most of the test cases, but this |
| 36 // cannot be set during the initialization. To test the initialization, | 36 // cannot be set during the initialization. To test the initialization, |
| 37 // consider using SetInitialLoginStatus() instead. | 37 // consider using SetInitialLoginStatus() instead. |
| 38 void SetLoginStatus(LoginStatus login_status); | 38 void SetLoginStatus(LoginStatus login_status); |
| 39 | 39 |
| 40 void set_should_show_display_notification(bool should_show) { | |
| 41 should_show_display_notification_ = should_show; | |
| 42 } | |
| 43 | |
| 44 // Updates the session length limit so that the limit will come from now in | 40 // Updates the session length limit so that the limit will come from now in |
| 45 // |new_limit|. | 41 // |new_limit|. |
| 46 void SetSessionLengthLimitForTest(const base::TimeDelta& new_limit); | 42 void SetSessionLengthLimitForTest(const base::TimeDelta& new_limit); |
| 47 | 43 |
| 48 // Clears the session length limit. | 44 // Clears the session length limit. |
| 49 void ClearSessionLengthLimit(); | 45 void ClearSessionLengthLimit(); |
| 50 | 46 |
| 51 // Sets the IME info. | 47 // Sets the IME info. |
| 52 void SetCurrentIME(const IMEInfo& info); | 48 void SetCurrentIME(const IMEInfo& info); |
| 53 | 49 |
| 54 // Sets the list of available IMEs. | 50 // Sets the list of available IMEs. |
| 55 void SetAvailableIMEList(const IMEInfoList& list); | 51 void SetAvailableIMEList(const IMEInfoList& list); |
| 56 | 52 |
| 57 // Overridden from SystemTrayDelegate: | 53 // Overridden from SystemTrayDelegate: |
| 58 LoginStatus GetUserLoginStatus() const override; | 54 LoginStatus GetUserLoginStatus() const override; |
| 59 bool IsUserSupervised() const override; | 55 bool IsUserSupervised() const override; |
| 60 void GetSystemUpdateInfo(UpdateInfo* info) const override; | 56 void GetSystemUpdateInfo(UpdateInfo* info) const override; |
| 61 bool ShouldShowDisplayNotification() override; | |
| 62 bool GetSessionStartTime(base::TimeTicks* session_start_time) override; | 57 bool GetSessionStartTime(base::TimeTicks* session_start_time) override; |
| 63 bool GetSessionLengthLimit(base::TimeDelta* session_length_limit) override; | 58 bool GetSessionLengthLimit(base::TimeDelta* session_length_limit) override; |
| 64 void SignOut() override; | 59 void SignOut() override; |
| 65 void GetCurrentIME(IMEInfo* info) override; | 60 void GetCurrentIME(IMEInfo* info) override; |
| 66 void GetAvailableIMEList(IMEInfoList* list) override; | 61 void GetAvailableIMEList(IMEInfoList* list) override; |
| 67 | 62 |
| 68 private: | 63 private: |
| 69 bool should_show_display_notification_; | |
| 70 LoginStatus login_status_; | 64 LoginStatus login_status_; |
| 71 base::TimeDelta session_length_limit_; | 65 base::TimeDelta session_length_limit_; |
| 72 bool session_length_limit_set_; | 66 bool session_length_limit_set_; |
| 73 IMEInfo current_ime_; | 67 IMEInfo current_ime_; |
| 74 IMEInfoList ime_list_; | 68 IMEInfoList ime_list_; |
| 75 | 69 |
| 76 DISALLOW_COPY_AND_ASSIGN(TestSystemTrayDelegate); | 70 DISALLOW_COPY_AND_ASSIGN(TestSystemTrayDelegate); |
| 77 }; | 71 }; |
| 78 | 72 |
| 79 } // namespace test | 73 } // namespace test |
| 80 } // namespace ash | 74 } // namespace ash |
| 81 | 75 |
| 82 #endif // ASH_COMMON_TEST_TEST_SYSTEM_TRAY_DELEGATE_H_ | 76 #endif // ASH_COMMON_TEST_TEST_SYSTEM_TRAY_DELEGATE_H_ |
| OLD | NEW |