Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: chrome/browser/policy/device_management_backend_impl.cc

Issue 6880031: Merge server-side changes of the cloud policy protocol (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/policy/device_management_service_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/device_management_backend_impl.h" 5 #include "chrome/browser/policy/device_management_backend_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #if defined(OS_POSIX) && !defined(OS_MACOSX) 10 #if defined(OS_POSIX) && !defined(OS_MACOSX)
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 return; 201 return;
202 } 202 }
203 203
204 switch (response_code) { 204 switch (response_code) {
205 case kSuccess: { 205 case kSuccess: {
206 em::DeviceManagementResponse response; 206 em::DeviceManagementResponse response;
207 if (!response.ParseFromString(data)) { 207 if (!response.ParseFromString(data)) {
208 OnError(DeviceManagementBackend::kErrorResponseDecoding); 208 OnError(DeviceManagementBackend::kErrorResponseDecoding);
209 return; 209 return;
210 } 210 }
211 if (response.has_error() &&
212 response.error() != em::DeviceManagementResponse_ErrorCode_SUCCESS) {
213 // TODO(pastarmovj): If we want to support legacy error codes in the
214 // protobuf this is the place to do so.
215 }
216 OnResponse(response); 211 OnResponse(response);
217 return; 212 return;
218 } 213 }
219 case kInvalidArgument: { 214 case kInvalidArgument: {
220 OnError(DeviceManagementBackend::kErrorRequestInvalid); 215 OnError(DeviceManagementBackend::kErrorRequestInvalid);
221 return; 216 return;
222 } 217 }
223 case kInvalidAuthCookieOrDMToken: { 218 case kInvalidAuthCookieOrDMToken: {
224 OnError(DeviceManagementBackend::kErrorServiceManagementTokenInvalid); 219 OnError(DeviceManagementBackend::kErrorServiceManagementTokenInvalid);
225 return; 220 return;
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 void DeviceManagementBackendImpl::ProcessPolicyRequest( 475 void DeviceManagementBackendImpl::ProcessPolicyRequest(
481 const std::string& device_management_token, 476 const std::string& device_management_token,
482 const std::string& device_id, 477 const std::string& device_id,
483 const em::DevicePolicyRequest& request, 478 const em::DevicePolicyRequest& request,
484 DevicePolicyResponseDelegate* delegate) { 479 DevicePolicyResponseDelegate* delegate) {
485 AddJob(new DeviceManagementPolicyJob(this, device_management_token, device_id, 480 AddJob(new DeviceManagementPolicyJob(this, device_management_token, device_id,
486 request, delegate)); 481 request, delegate));
487 } 482 }
488 483
489 } // namespace policy 484 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/policy/device_management_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698