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

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

Issue 10664017: Introduce a new error code from the DM server - 402 - missing licenses. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: s/serials/licenses// Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/policy/device_token_fetcher.h ('k') | chrome/browser/policy/enterprise_metrics.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/device_token_fetcher.cc
diff --git a/chrome/browser/policy/device_token_fetcher.cc b/chrome/browser/policy/device_token_fetcher.cc
index d9cde61fa5e1c15cd867f85863429c7c0af6e59e..1cddd69d35b79ff49e21dc2496900e1e1faa7e59 100644
--- a/chrome/browser/policy/device_token_fetcher.cc
+++ b/chrome/browser/policy/device_token_fetcher.cc
@@ -60,6 +60,9 @@ void SampleErrorStatus(DeviceManagementStatus status) {
case DM_STATUS_RESPONSE_DECODING_ERROR:
sample = kMetricTokenFetchBadResponse;
break;
+ case DM_STATUS_MISSING_LICENSES:
+ sample = kMetricMissingLicenses;
+ break;
case DM_STATUS_TEMPORARY_UNAVAILABLE:
case DM_STATUS_SERVICE_ACTIVATION_PENDING:
case DM_STATUS_SERVICE_POLICY_NOT_FOUND:
@@ -135,6 +138,10 @@ void DeviceTokenFetcher::SetSerialNumberInvalidState() {
SetState(STATE_BAD_SERIAL);
}
+void DeviceTokenFetcher::SetMissingLicensesState() {
+ SetState(STATE_MISSING_LICENSES);
+}
+
void DeviceTokenFetcher::Reset() {
SetState(STATE_INACTIVE);
}
@@ -248,6 +255,9 @@ void DeviceTokenFetcher::OnTokenFetchCompleted(
case DM_STATUS_SERVICE_INVALID_SERIAL_NUMBER:
SetSerialNumberInvalidState();
return;
+ case DM_STATUS_MISSING_LICENSES:
+ SetMissingLicensesState();
+ return;
case DM_STATUS_REQUEST_INVALID:
case DM_STATUS_HTTP_STATUS_ERROR:
case DM_STATUS_RESPONSE_DECODING_ERROR:
@@ -289,6 +299,11 @@ void DeviceTokenFetcher::SetState(FetcherState state) {
CloudPolicySubsystem::BAD_ENROLLMENT_MODE,
PolicyNotifier::TOKEN_FETCHER);
break;
+ case STATE_MISSING_LICENSES:
+ notifier_->Inform(CloudPolicySubsystem::UNENROLLED,
+ CloudPolicySubsystem::MISSING_LICENSES,
+ PolicyNotifier::TOKEN_FETCHER);
+ break;
case STATE_UNMANAGED:
delayed_work_at = cache_->last_policy_refresh_time() +
base::TimeDelta::FromMilliseconds(
@@ -345,6 +360,7 @@ void DeviceTokenFetcher::DoWork() {
case STATE_TOKEN_AVAILABLE:
case STATE_BAD_SERIAL:
case STATE_BAD_ENROLLMENT_MODE:
+ case STATE_MISSING_LICENSES:
break;
case STATE_UNMANAGED:
case STATE_ERROR:
« no previous file with comments | « chrome/browser/policy/device_token_fetcher.h ('k') | chrome/browser/policy/enterprise_metrics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698