OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/settings/device_settings_test_helper.h" | 5 #include "chrome/browser/chromeos/settings/device_settings_test_helper.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/threading/sequenced_worker_pool.h" | 9 #include "base/threading/sequenced_worker_pool.h" |
10 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" | 10 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 for (device_local_account_state = device_local_account_policy_.begin(); | 85 for (device_local_account_state = device_local_account_policy_.begin(); |
86 device_local_account_state != device_local_account_policy_.end(); | 86 device_local_account_state != device_local_account_policy_.end(); |
87 ++device_local_account_state) { | 87 ++device_local_account_state) { |
88 if (device_local_account_state->second.HasPendingOperations()) | 88 if (device_local_account_state->second.HasPendingOperations()) |
89 return true; | 89 return true; |
90 } | 90 } |
91 | 91 |
92 return false; | 92 return false; |
93 } | 93 } |
94 | 94 |
95 void DeviceSettingsTestHelper::Init(dbus::Bus* bus) {} | |
96 | |
97 void DeviceSettingsTestHelper::SetStubDelegate( | |
98 SessionManagerClient::StubDelegate* delegate) {} | |
99 | |
100 void DeviceSettingsTestHelper::AddObserver(Observer* observer) {} | |
101 | |
102 void DeviceSettingsTestHelper::RemoveObserver(Observer* observer) {} | |
103 | |
104 bool DeviceSettingsTestHelper::HasObserver(const Observer* observer) const { | |
105 return false; | |
106 } | |
107 | |
108 bool DeviceSettingsTestHelper::IsScreenLocked() const { return false; } | |
109 | |
110 void DeviceSettingsTestHelper::EmitLoginPromptVisible() {} | |
111 | |
112 void DeviceSettingsTestHelper::RestartJob( | |
113 int socket_fd, | |
114 const std::vector<std::string>& argv, | |
115 const VoidDBusMethodCallback& callback) {} | |
116 | |
117 void DeviceSettingsTestHelper::StartSession( | |
118 const cryptohome::Identification& cryptohome_id) {} | |
119 | |
120 void DeviceSettingsTestHelper::StopSession() {} | |
121 | |
122 void DeviceSettingsTestHelper::NotifySupervisedUserCreationStarted() {} | |
123 | |
124 void DeviceSettingsTestHelper::NotifySupervisedUserCreationFinished() {} | |
125 | |
126 void DeviceSettingsTestHelper::StartDeviceWipe() {} | |
127 | |
128 void DeviceSettingsTestHelper::RequestLockScreen() {} | |
129 | |
130 void DeviceSettingsTestHelper::NotifyLockScreenShown() {} | |
131 | |
132 void DeviceSettingsTestHelper::NotifyLockScreenDismissed() {} | |
133 | |
134 void DeviceSettingsTestHelper::RetrieveActiveSessions( | |
135 const ActiveSessionsCallback& callback) {} | |
136 | |
137 void DeviceSettingsTestHelper::RetrieveDevicePolicy( | 95 void DeviceSettingsTestHelper::RetrieveDevicePolicy( |
138 const RetrievePolicyCallback& callback) { | 96 const RetrievePolicyCallback& callback) { |
139 device_policy_.retrieve_callbacks_.push_back(callback); | 97 device_policy_.retrieve_callbacks_.push_back(callback); |
140 } | 98 } |
141 | 99 |
142 void DeviceSettingsTestHelper::RetrievePolicyForUser( | |
143 const cryptohome::Identification& cryptohome_id, | |
144 const RetrievePolicyCallback& callback) {} | |
145 | |
146 std::string DeviceSettingsTestHelper::BlockingRetrievePolicyForUser( | |
147 const cryptohome::Identification& cryptohome_id) { | |
148 return ""; | |
149 } | |
150 | |
151 void DeviceSettingsTestHelper::RetrieveDeviceLocalAccountPolicy( | 100 void DeviceSettingsTestHelper::RetrieveDeviceLocalAccountPolicy( |
152 const std::string& account_id, | 101 const std::string& account_id, |
153 const RetrievePolicyCallback& callback) { | 102 const RetrievePolicyCallback& callback) { |
154 device_local_account_policy_[account_id].retrieve_callbacks_.push_back( | 103 device_local_account_policy_[account_id].retrieve_callbacks_.push_back( |
155 callback); | 104 callback); |
156 } | 105 } |
157 | 106 |
158 void DeviceSettingsTestHelper::StoreDevicePolicy( | 107 void DeviceSettingsTestHelper::StoreDevicePolicy( |
159 const std::string& policy_blob, | 108 const std::string& policy_blob, |
160 const StorePolicyCallback& callback) { | 109 const StorePolicyCallback& callback) { |
161 device_policy_.policy_blob_ = policy_blob; | 110 device_policy_.policy_blob_ = policy_blob; |
162 device_policy_.store_callbacks_.push_back(callback); | 111 device_policy_.store_callbacks_.push_back(callback); |
163 } | 112 } |
164 | 113 |
165 void DeviceSettingsTestHelper::StorePolicyForUser( | |
166 const cryptohome::Identification& cryptohome_id, | |
167 const std::string& policy_blob, | |
168 const StorePolicyCallback& callback) {} | |
169 | |
170 void DeviceSettingsTestHelper::StoreDeviceLocalAccountPolicy( | 114 void DeviceSettingsTestHelper::StoreDeviceLocalAccountPolicy( |
171 const std::string& account_id, | 115 const std::string& account_id, |
172 const std::string& policy_blob, | 116 const std::string& policy_blob, |
173 const StorePolicyCallback& callback) { | 117 const StorePolicyCallback& callback) { |
174 device_local_account_policy_[account_id].policy_blob_ = policy_blob; | 118 device_local_account_policy_[account_id].policy_blob_ = policy_blob; |
175 device_local_account_policy_[account_id].store_callbacks_.push_back(callback); | 119 device_local_account_policy_[account_id].store_callbacks_.push_back(callback); |
176 } | 120 } |
177 | 121 |
178 bool DeviceSettingsTestHelper::SupportsRestartToApplyUserFlags() const { | |
179 return false; | |
180 } | |
181 | |
182 void DeviceSettingsTestHelper::SetFlagsForUser( | |
183 const cryptohome::Identification& cryptohome_id, | |
184 const std::vector<std::string>& flags) {} | |
185 | |
186 void DeviceSettingsTestHelper::GetServerBackedStateKeys( | |
187 const StateKeysCallback& callback) {} | |
188 | |
189 void DeviceSettingsTestHelper::CheckArcAvailability( | |
190 const ArcCallback& callback) {} | |
191 | |
192 void DeviceSettingsTestHelper::StartArcInstance( | |
193 const cryptohome::Identification& cryptohome_id, | |
194 bool disable_boot_completed_broadcast, | |
195 const StartArcInstanceCallback& callback) {} | |
196 | |
197 void DeviceSettingsTestHelper::StopArcInstance(const ArcCallback& callback) {} | |
198 | |
199 void DeviceSettingsTestHelper::SetArcCpuRestriction( | |
200 login_manager::ContainerCpuRestrictionState restriction_state, | |
201 const ArcCallback& callback) {} | |
202 | |
203 void DeviceSettingsTestHelper::EmitArcBooted( | |
204 const cryptohome::Identification& cryptohome_id, | |
205 const ArcCallback& callback) {} | |
206 | |
207 void DeviceSettingsTestHelper::GetArcStartTime( | |
208 const GetArcStartTimeCallback& callback) {} | |
209 | |
210 void DeviceSettingsTestHelper::RemoveArcData( | |
211 const cryptohome::Identification& cryptohome_id, | |
212 const ArcCallback& callback) {} | |
213 | |
214 DeviceSettingsTestHelper::PolicyState::PolicyState() | 122 DeviceSettingsTestHelper::PolicyState::PolicyState() |
215 : store_result_(true) {} | 123 : store_result_(true) {} |
216 | 124 |
217 DeviceSettingsTestHelper::PolicyState::PolicyState(const PolicyState& other) = | 125 DeviceSettingsTestHelper::PolicyState::PolicyState(const PolicyState& other) = |
218 default; | 126 default; |
219 | 127 |
220 DeviceSettingsTestHelper::PolicyState::~PolicyState() {} | 128 DeviceSettingsTestHelper::PolicyState::~PolicyState() {} |
221 | 129 |
222 ScopedDeviceSettingsTestHelper::ScopedDeviceSettingsTestHelper() { | 130 ScopedDeviceSettingsTestHelper::ScopedDeviceSettingsTestHelper() { |
223 DeviceSettingsService::Initialize(); | 131 DeviceSettingsService::Initialize(); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 const_cast<user_manager::User*>(user)); | 201 const_cast<user_manager::User*>(user)); |
294 } | 202 } |
295 OwnerSettingsServiceChromeOS* service = | 203 OwnerSettingsServiceChromeOS* service = |
296 OwnerSettingsServiceChromeOSFactory::GetForBrowserContext(profile_.get()); | 204 OwnerSettingsServiceChromeOSFactory::GetForBrowserContext(profile_.get()); |
297 CHECK(service); | 205 CHECK(service); |
298 if (tpm_is_ready) | 206 if (tpm_is_ready) |
299 service->OnTPMTokenReady(true /* token is enabled */); | 207 service->OnTPMTokenReady(true /* token is enabled */); |
300 } | 208 } |
301 | 209 |
302 } // namespace chromeos | 210 } // namespace chromeos |
OLD | NEW |