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/policy/device_local_account_policy_service.h" | 5 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "chrome/browser/chromeos/policy/device_local_account_policy_store.h" | 9 #include "chrome/browser/chromeos/policy/device_local_account_policy_store.h" |
10 #include "chrome/browser/policy/cloud/cloud_policy_client.h" | 10 #include "chrome/browser/policy/cloud/cloud_policy_client.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 PolicyBrokerMap new_policy_brokers; | 164 PolicyBrokerMap new_policy_brokers; |
165 const RepeatedPtrField<em::DeviceLocalAccountInfoProto>& accounts = | 165 const RepeatedPtrField<em::DeviceLocalAccountInfoProto>& accounts = |
166 device_settings.device_local_accounts().account(); | 166 device_settings.device_local_accounts().account(); |
167 RepeatedPtrField<em::DeviceLocalAccountInfoProto>::const_iterator entry; | 167 RepeatedPtrField<em::DeviceLocalAccountInfoProto>::const_iterator entry; |
168 for (entry = accounts.begin(); entry != accounts.end(); ++entry) { | 168 for (entry = accounts.begin(); entry != accounts.end(); ++entry) { |
169 std::string account_id; | 169 std::string account_id; |
170 if (entry->has_type() && | 170 if (entry->has_type() && |
171 entry->type() == | 171 entry->type() == |
172 em::DeviceLocalAccountInfoProto::ACCOUNT_TYPE_PUBLIC_SESSION) { | 172 em::DeviceLocalAccountInfoProto::ACCOUNT_TYPE_PUBLIC_SESSION) { |
173 account_id = entry->account_id(); | 173 account_id = entry->account_id(); |
174 } else if (entry->has_id()) { | 174 } else if (entry->has_deprecated_public_session_id()) { |
175 account_id = entry->id(); | 175 account_id = entry->deprecated_public_session_id(); |
176 } | 176 } |
177 | 177 |
178 if (account_id.empty()) | 178 if (account_id.empty()) |
179 continue; | 179 continue; |
180 | 180 |
181 // Sanity check for whether this account ID has already been processed. | 181 // Sanity check for whether this account ID has already been processed. |
182 DeviceLocalAccountPolicyBroker*& new_broker = | 182 DeviceLocalAccountPolicyBroker*& new_broker = |
183 new_policy_brokers[account_id]; | 183 new_policy_brokers[account_id]; |
184 if (new_broker) { | 184 if (new_broker) { |
185 LOG(WARNING) << "Duplicate public account " << account_id; | 185 LOG(WARNING) << "Duplicate public account " << account_id; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 scoped_ptr<CloudPolicyClient> client( | 259 scoped_ptr<CloudPolicyClient> client( |
260 new CloudPolicyClient(std::string(), std::string(), | 260 new CloudPolicyClient(std::string(), std::string(), |
261 USER_AFFILIATION_MANAGED, | 261 USER_AFFILIATION_MANAGED, |
262 NULL, device_management_service_)); | 262 NULL, device_management_service_)); |
263 client->SetupRegistration(policy_data->request_token(), | 263 client->SetupRegistration(policy_data->request_token(), |
264 policy_data->device_id()); | 264 policy_data->device_id()); |
265 return client.Pass(); | 265 return client.Pass(); |
266 } | 266 } |
267 | 267 |
268 } // namespace policy | 268 } // namespace policy |
OLD | NEW |