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

Unified Diff: chrome/browser/policy/device_management_backend_impl.cc

Issue 5388001: Tweaks to POST request to device management server (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/policy/device_management_backend_impl.cc
diff --git a/chrome/browser/policy/device_management_backend_impl.cc b/chrome/browser/policy/device_management_backend_impl.cc
index 11e5fea01e7e015714ae1abfaed0983d52883637..d479c801fe63668a8806501dd3254aceb01d7090 100644
--- a/chrome/browser/policy/device_management_backend_impl.cc
+++ b/chrome/browser/policy/device_management_backend_impl.cc
@@ -34,7 +34,7 @@ namespace {
const char kValueAgent[] = "%s enterprise management client version %s (%s)";
-const char kPostContentType[] = "application/octet-stream";
+const char kPostContentType[] = "application/protobuf";
const char kServiceTokenAuthHeader[] = "Authorization: GoogleLogin auth=";
const char kDMTokenAuthHeader[] = "Authorization: GoogleDMToken token=";
@@ -182,7 +182,8 @@ void DeviceManagementJobBase::HandleResponse(const URLRequestStatus& status,
// Check service error code.
switch (response.error()) {
case em::DeviceManagementResponse::SUCCESS:
- break;
+ OnResponse(response);
+ return;
case em::DeviceManagementResponse::DEVICE_MANAGEMENT_NOT_SUPPORTED:
OnError(DeviceManagementBackend::kErrorServiceManagementNotSupported);
return;
@@ -195,14 +196,14 @@ void DeviceManagementJobBase::HandleResponse(const URLRequestStatus& status,
case em::DeviceManagementResponse::ACTIVATION_PENDING:
OnError(DeviceManagementBackend::kErrorServiceActivationPending);
return;
- default:
- // This should be caught by the protobuf decoder.
- NOTREACHED();
- OnError(DeviceManagementBackend::kErrorResponseDecoding);
+ case em::DeviceManagementResponse::POLICY_NOT_FOUND:
+ OnError(DeviceManagementBackend::kErrorServicePolicyNotFound);
return;
}
- OnResponse(response);
+ // This should be caught by the protobuf decoder.
+ NOTREACHED();
+ OnError(DeviceManagementBackend::kErrorResponseDecoding);
}
GURL DeviceManagementJobBase::GetURL(
« no previous file with comments | « chrome/browser/policy/device_management_backend.h ('k') | chrome/browser/policy/device_management_policy_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698