| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 void DeviceSettingsTestHelper::NotifyLockScreenDismissed() {} | 132 void DeviceSettingsTestHelper::NotifyLockScreenDismissed() {} |
| 133 | 133 |
| 134 void DeviceSettingsTestHelper::RetrieveActiveSessions( | 134 void DeviceSettingsTestHelper::RetrieveActiveSessions( |
| 135 const ActiveSessionsCallback& callback) {} | 135 const ActiveSessionsCallback& callback) {} |
| 136 | 136 |
| 137 void DeviceSettingsTestHelper::RetrieveDevicePolicy( | 137 void DeviceSettingsTestHelper::RetrieveDevicePolicy( |
| 138 const RetrievePolicyCallback& callback) { | 138 const RetrievePolicyCallback& callback) { |
| 139 device_policy_.retrieve_callbacks_.push_back(callback); | 139 device_policy_.retrieve_callbacks_.push_back(callback); |
| 140 } | 140 } |
| 141 | 141 |
| 142 std::string DeviceSettingsTestHelper::BlockingRetrieveDevicePolicy() { |
| 143 return ""; |
| 144 } |
| 145 |
| 142 void DeviceSettingsTestHelper::RetrievePolicyForUser( | 146 void DeviceSettingsTestHelper::RetrievePolicyForUser( |
| 143 const cryptohome::Identification& cryptohome_id, | 147 const cryptohome::Identification& cryptohome_id, |
| 144 const RetrievePolicyCallback& callback) {} | 148 const RetrievePolicyCallback& callback) {} |
| 145 | 149 |
| 146 std::string DeviceSettingsTestHelper::BlockingRetrievePolicyForUser( | 150 std::string DeviceSettingsTestHelper::BlockingRetrievePolicyForUser( |
| 147 const cryptohome::Identification& cryptohome_id) { | 151 const cryptohome::Identification& cryptohome_id) { |
| 148 return ""; | 152 return ""; |
| 149 } | 153 } |
| 150 | 154 |
| 151 void DeviceSettingsTestHelper::RetrieveDeviceLocalAccountPolicy( | 155 void DeviceSettingsTestHelper::RetrieveDeviceLocalAccountPolicy( |
| 152 const std::string& account_id, | 156 const std::string& account_id, |
| 153 const RetrievePolicyCallback& callback) { | 157 const RetrievePolicyCallback& callback) { |
| 154 device_local_account_policy_[account_id].retrieve_callbacks_.push_back( | 158 device_local_account_policy_[account_id].retrieve_callbacks_.push_back( |
| 155 callback); | 159 callback); |
| 156 } | 160 } |
| 157 | 161 |
| 162 std::string DeviceSettingsTestHelper::BlockingRetrieveDeviceLocalAccountPolicy( |
| 163 const std::string& account_id) { |
| 164 return ""; |
| 165 } |
| 166 |
| 158 void DeviceSettingsTestHelper::StoreDevicePolicy( | 167 void DeviceSettingsTestHelper::StoreDevicePolicy( |
| 159 const std::string& policy_blob, | 168 const std::string& policy_blob, |
| 160 const StorePolicyCallback& callback) { | 169 const StorePolicyCallback& callback) { |
| 161 device_policy_.policy_blob_ = policy_blob; | 170 device_policy_.policy_blob_ = policy_blob; |
| 162 device_policy_.store_callbacks_.push_back(callback); | 171 device_policy_.store_callbacks_.push_back(callback); |
| 163 } | 172 } |
| 164 | 173 |
| 165 void DeviceSettingsTestHelper::StorePolicyForUser( | 174 void DeviceSettingsTestHelper::StorePolicyForUser( |
| 166 const cryptohome::Identification& cryptohome_id, | 175 const cryptohome::Identification& cryptohome_id, |
| 167 const std::string& policy_blob, | 176 const std::string& policy_blob, |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 const_cast<user_manager::User*>(user)); | 302 const_cast<user_manager::User*>(user)); |
| 294 } | 303 } |
| 295 OwnerSettingsServiceChromeOS* service = | 304 OwnerSettingsServiceChromeOS* service = |
| 296 OwnerSettingsServiceChromeOSFactory::GetForBrowserContext(profile_.get()); | 305 OwnerSettingsServiceChromeOSFactory::GetForBrowserContext(profile_.get()); |
| 297 CHECK(service); | 306 CHECK(service); |
| 298 if (tpm_is_ready) | 307 if (tpm_is_ready) |
| 299 service->OnTPMTokenReady(true /* token is enabled */); | 308 service->OnTPMTokenReady(true /* token is enabled */); |
| 300 } | 309 } |
| 301 | 310 |
| 302 } // namespace chromeos | 311 } // namespace chromeos |
| OLD | NEW |