| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 !policy_data->has_request_token() || | 54 !policy_data->has_request_token() || |
| 55 !policy_data->has_device_id() || | 55 !policy_data->has_device_id() || |
| 56 !device_management_service) { | 56 !device_management_service) { |
| 57 return scoped_ptr<CloudPolicyClient>(); | 57 return scoped_ptr<CloudPolicyClient>(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 scoped_refptr<net::URLRequestContextGetter> request_context = | 60 scoped_refptr<net::URLRequestContextGetter> request_context = |
| 61 new SystemPolicyRequestContext( | 61 new SystemPolicyRequestContext( |
| 62 system_request_context, | 62 system_request_context, |
| 63 content::GetUserAgent(GURL( | 63 content::GetUserAgent(GURL( |
| 64 device_management_service->GetServerURL()))); | 64 device_management_service->GetServerUrl()))); |
| 65 | 65 |
| 66 scoped_ptr<CloudPolicyClient> client( | 66 scoped_ptr<CloudPolicyClient> client( |
| 67 new CloudPolicyClient(std::string(), std::string(), | 67 new CloudPolicyClient(std::string(), std::string(), |
| 68 USER_AFFILIATION_MANAGED, | 68 USER_AFFILIATION_MANAGED, |
| 69 NULL, device_management_service, request_context)); | 69 NULL, device_management_service, request_context)); |
| 70 client->SetupRegistration(policy_data->request_token(), | 70 client->SetupRegistration(policy_data->request_token(), |
| 71 policy_data->device_id()); | 71 policy_data->device_id()); |
| 72 return client.Pass(); | 72 return client.Pass(); |
| 73 } | 73 } |
| 74 | 74 |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 CloudPolicyStore* store) { | 503 CloudPolicyStore* store) { |
| 504 for (PolicyBrokerMap::iterator it(policy_brokers_.begin()); | 504 for (PolicyBrokerMap::iterator it(policy_brokers_.begin()); |
| 505 it != policy_brokers_.end(); ++it) { | 505 it != policy_brokers_.end(); ++it) { |
| 506 if (it->second->core()->store() == store) | 506 if (it->second->core()->store() == store) |
| 507 return it->second; | 507 return it->second; |
| 508 } | 508 } |
| 509 return NULL; | 509 return NULL; |
| 510 } | 510 } |
| 511 | 511 |
| 512 } // namespace policy | 512 } // namespace policy |
| OLD | NEW |