Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: ash/test/test_system_tray_delegate.h

Issue 2826313002: cros: Use SessionController in UserMetricsRecorder to get login status (Closed)
Patch Set: review comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/metrics/user_metrics_recorder_unittest.cc ('k') | ash/test/test_system_tray_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "base/time/time.h" 11 #include "base/time/time.h"
12 12
13 namespace ash { 13 namespace ash {
14 namespace test { 14 namespace test {
15 15
16 class TestSystemTrayDelegate : public SystemTrayDelegate { 16 class TestSystemTrayDelegate : public SystemTrayDelegate {
17 public: 17 public:
18 TestSystemTrayDelegate(); 18 TestSystemTrayDelegate();
19 ~TestSystemTrayDelegate() override; 19 ~TestSystemTrayDelegate() override;
20 20
21 // Changes the current login status in the test. This also invokes
22 // UpdateAfterLoginStatusChange(). Usually this is called in the test code to
23 // set up a login status. This will fit to most of the test cases, but this
24 // cannot be set during the initialization. To test the initialization,
25 // consider using SetInitialLoginStatus() instead.
26 // TODO(jamescook): Eliminate this method and |login_status_|.
27 void SetLoginStatus(LoginStatus login_status);
28
29 // Updates the session length limit so that the limit will come from now in 21 // Updates the session length limit so that the limit will come from now in
30 // |new_limit|. 22 // |new_limit|.
31 void SetSessionLengthLimitForTest(const base::TimeDelta& new_limit); 23 void SetSessionLengthLimitForTest(const base::TimeDelta& new_limit);
32 24
33 // Clears the session length limit. 25 // Clears the session length limit.
34 void ClearSessionLengthLimit(); 26 void ClearSessionLengthLimit();
35 27
36 // Sets the IME info. 28 // Sets the IME info.
37 void SetCurrentIME(const IMEInfo& info); 29 void SetCurrentIME(const IMEInfo& info);
38 30
39 // Sets the list of available IMEs. 31 // Sets the list of available IMEs.
40 void SetAvailableIMEList(const IMEInfoList& list); 32 void SetAvailableIMEList(const IMEInfoList& list);
41 33
42 // SystemTrayDelegate: 34 // SystemTrayDelegate:
43 LoginStatus GetUserLoginStatus() const override; 35 LoginStatus GetUserLoginStatus() const override;
44 std::string GetSupervisedUserManager() const override; 36 std::string GetSupervisedUserManager() const override;
45 bool GetSessionStartTime(base::TimeTicks* session_start_time) override; 37 bool GetSessionStartTime(base::TimeTicks* session_start_time) override;
46 bool GetSessionLengthLimit(base::TimeDelta* session_length_limit) override; 38 bool GetSessionLengthLimit(base::TimeDelta* session_length_limit) override;
47 void GetCurrentIME(IMEInfo* info) override; 39 void GetCurrentIME(IMEInfo* info) override;
48 void GetAvailableIMEList(IMEInfoList* list) override; 40 void GetAvailableIMEList(IMEInfoList* list) override;
49 41
50 private: 42 private:
51 LoginStatus login_status_;
52 base::TimeDelta session_length_limit_; 43 base::TimeDelta session_length_limit_;
53 bool session_length_limit_set_; 44 bool session_length_limit_set_ = false;
54 IMEInfo current_ime_; 45 IMEInfo current_ime_;
55 IMEInfoList ime_list_; 46 IMEInfoList ime_list_;
56 47
57 DISALLOW_COPY_AND_ASSIGN(TestSystemTrayDelegate); 48 DISALLOW_COPY_AND_ASSIGN(TestSystemTrayDelegate);
58 }; 49 };
59 50
60 } // namespace test 51 } // namespace test
61 } // namespace ash 52 } // namespace ash
62 53
63 #endif // ASH_TEST_TEST_SYSTEM_TRAY_DELEGATE_H_ 54 #endif // ASH_TEST_TEST_SYSTEM_TRAY_DELEGATE_H_
OLDNEW
« no previous file with comments | « ash/metrics/user_metrics_recorder_unittest.cc ('k') | ash/test/test_system_tray_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698