| 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/policy/cloud/device_management_service.h" | 5 #include "chrome/browser/policy/cloud/device_management_service.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 } | 137 } |
| 138 | 138 |
| 139 const char* JobTypeToRequestType(DeviceManagementRequestJob::JobType type) { | 139 const char* JobTypeToRequestType(DeviceManagementRequestJob::JobType type) { |
| 140 switch (type) { | 140 switch (type) { |
| 141 case DeviceManagementRequestJob::TYPE_AUTO_ENROLLMENT: | 141 case DeviceManagementRequestJob::TYPE_AUTO_ENROLLMENT: |
| 142 return dm_protocol::kValueRequestAutoEnrollment; | 142 return dm_protocol::kValueRequestAutoEnrollment; |
| 143 case DeviceManagementRequestJob::TYPE_REGISTRATION: | 143 case DeviceManagementRequestJob::TYPE_REGISTRATION: |
| 144 return dm_protocol::kValueRequestRegister; | 144 return dm_protocol::kValueRequestRegister; |
| 145 case DeviceManagementRequestJob::TYPE_POLICY_FETCH: | 145 case DeviceManagementRequestJob::TYPE_POLICY_FETCH: |
| 146 return dm_protocol::kValueRequestPolicy; | 146 return dm_protocol::kValueRequestPolicy; |
| 147 case DeviceManagementRequestJob::TYPE_API_AUTH_CODE_FETCH: |
| 148 return dm_protocol::kValueRequestApiAuthorization; |
| 147 case DeviceManagementRequestJob::TYPE_UNREGISTRATION: | 149 case DeviceManagementRequestJob::TYPE_UNREGISTRATION: |
| 148 return dm_protocol::kValueRequestUnregister; | 150 return dm_protocol::kValueRequestUnregister; |
| 149 } | 151 } |
| 150 NOTREACHED() << "Invalid job type " << type; | 152 NOTREACHED() << "Invalid job type " << type; |
| 151 return ""; | 153 return ""; |
| 152 } | 154 } |
| 153 | 155 |
| 154 const std::string& GetAgentString() { | 156 const std::string& GetAgentString() { |
| 155 CR_DEFINE_STATIC_LOCAL(std::string, agent, ()); | 157 CR_DEFINE_STATIC_LOCAL(std::string, agent, ()); |
| 156 if (!agent.empty()) | 158 if (!agent.empty()) |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 } | 643 } |
| 642 } | 644 } |
| 643 | 645 |
| 644 const JobQueue::iterator elem = | 646 const JobQueue::iterator elem = |
| 645 std::find(queued_jobs_.begin(), queued_jobs_.end(), job); | 647 std::find(queued_jobs_.begin(), queued_jobs_.end(), job); |
| 646 if (elem != queued_jobs_.end()) | 648 if (elem != queued_jobs_.end()) |
| 647 queued_jobs_.erase(elem); | 649 queued_jobs_.erase(elem); |
| 648 } | 650 } |
| 649 | 651 |
| 650 } // namespace policy | 652 } // namespace policy |
| OLD | NEW |