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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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) { | 66 void TestSystemTrayDelegate::SetCurrentIME(const IMEInfo& info) { |
67 current_ime_ = info; | 67 current_ime_ = info; |
68 } | 68 } |
69 | 69 |
70 void TestSystemTrayDelegate::SetAvailableIMEList(const IMEInfoList& list) { | |
71 ime_list_.clear(); | |
James Cook
2016/08/24 16:03:53
Does ime_list_ = list; work?
Azure Wei
2016/08/25 02:10:44
Done.
| |
72 for (auto ime : list) { | |
73 ime_list_.push_back(ime); | |
74 } | |
75 } | |
76 | |
70 LoginStatus TestSystemTrayDelegate::GetUserLoginStatus() const { | 77 LoginStatus TestSystemTrayDelegate::GetUserLoginStatus() const { |
71 // Initial login status has been changed for testing. | 78 // Initial login status has been changed for testing. |
72 if (g_initial_status != LoginStatus::USER && | 79 if (g_initial_status != LoginStatus::USER && |
73 g_initial_status == login_status_) { | 80 g_initial_status == login_status_) { |
74 return login_status_; | 81 return login_status_; |
75 } | 82 } |
76 | 83 |
77 // At new user image screen manager->IsUserLoggedIn() would return true | 84 // At new user image screen manager->IsUserLoggedIn() would return true |
78 // but there's no browser session available yet so use SessionStarted(). | 85 // but there's no browser session available yet so use SessionStarted(). |
79 SessionStateDelegate* delegate = WmShell::Get()->GetSessionStateDelegate(); | 86 SessionStateDelegate* delegate = WmShell::Get()->GetSessionStateDelegate(); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
135 return base::MakeUnique<TrayRotationLock>(tray); | 142 return base::MakeUnique<TrayRotationLock>(tray); |
136 #else | 143 #else |
137 return nullptr; | 144 return nullptr; |
138 #endif | 145 #endif |
139 } | 146 } |
140 | 147 |
141 void TestSystemTrayDelegate::GetCurrentIME(IMEInfo* info) { | 148 void TestSystemTrayDelegate::GetCurrentIME(IMEInfo* info) { |
142 *info = current_ime_; | 149 *info = current_ime_; |
143 } | 150 } |
144 | 151 |
152 void TestSystemTrayDelegate::GetAvailableIMEList(IMEInfoList* list) { | |
153 for (size_t i = 0; i < ime_list_.size(); i++) { | |
James Cook
2016/08/24 16:03:53
Does *list = ime_list_; work?
Azure Wei
2016/08/25 02:10:44
Done.
| |
154 list->push_back(ime_list_[i]); | |
155 } | |
156 } | |
157 | |
145 } // namespace test | 158 } // namespace test |
146 } // namespace ash | 159 } // namespace ash |
OLD | NEW |