| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/login/enrollment/enterprise_enrollment_helper_
impl.h" | 5 #include "chrome/browser/chromeos/login/enrollment/enterprise_enrollment_helper_
impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 bool success) { | 256 bool success) { |
| 257 status_consumer()->OnDeviceAttributeUploadCompleted(success); | 257 status_consumer()->OnDeviceAttributeUploadCompleted(success); |
| 258 } | 258 } |
| 259 | 259 |
| 260 void EnterpriseEnrollmentHelperImpl::ReportAuthStatus( | 260 void EnterpriseEnrollmentHelperImpl::ReportAuthStatus( |
| 261 const GoogleServiceAuthError& error) { | 261 const GoogleServiceAuthError& error) { |
| 262 switch (error.state()) { | 262 switch (error.state()) { |
| 263 case GoogleServiceAuthError::NONE: | 263 case GoogleServiceAuthError::NONE: |
| 264 case GoogleServiceAuthError::CAPTCHA_REQUIRED: | 264 case GoogleServiceAuthError::CAPTCHA_REQUIRED: |
| 265 case GoogleServiceAuthError::TWO_FACTOR: | 265 case GoogleServiceAuthError::TWO_FACTOR: |
| 266 case GoogleServiceAuthError::HOSTED_NOT_ALLOWED: | |
| 267 case GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS: | 266 case GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS: |
| 268 case GoogleServiceAuthError::REQUEST_CANCELED: | 267 case GoogleServiceAuthError::REQUEST_CANCELED: |
| 269 case GoogleServiceAuthError::UNEXPECTED_SERVICE_RESPONSE: | 268 case GoogleServiceAuthError::UNEXPECTED_SERVICE_RESPONSE: |
| 270 case GoogleServiceAuthError::SERVICE_ERROR: | 269 case GoogleServiceAuthError::SERVICE_ERROR: |
| 271 case GoogleServiceAuthError::WEB_LOGIN_REQUIRED: | 270 case GoogleServiceAuthError::WEB_LOGIN_REQUIRED: |
| 272 UMA(policy::kMetricEnrollmentLoginFailed); | 271 UMA(policy::kMetricEnrollmentLoginFailed); |
| 273 LOG(ERROR) << "Auth error " << error.state(); | 272 LOG(ERROR) << "Auth error " << error.state(); |
| 274 break; | 273 break; |
| 275 case GoogleServiceAuthError::USER_NOT_SIGNED_UP: | 274 case GoogleServiceAuthError::USER_NOT_SIGNED_UP: |
| 276 UMA(policy::kMetricEnrollmentAccountNotSignedUp); | 275 UMA(policy::kMetricEnrollmentAccountNotSignedUp); |
| 277 LOG(ERROR) << "Account not signed up " << error.state(); | 276 LOG(ERROR) << "Account not signed up " << error.state(); |
| 278 break; | 277 break; |
| 279 case GoogleServiceAuthError::ACCOUNT_DELETED: | 278 case GoogleServiceAuthError::ACCOUNT_DELETED: |
| 280 UMA(policy::kMetricEnrollmentAccountDeleted); | 279 UMA(policy::kMetricEnrollmentAccountDeleted); |
| 281 LOG(ERROR) << "Account deleted " << error.state(); | 280 LOG(ERROR) << "Account deleted " << error.state(); |
| 282 break; | 281 break; |
| 283 case GoogleServiceAuthError::ACCOUNT_DISABLED: | 282 case GoogleServiceAuthError::ACCOUNT_DISABLED: |
| 284 UMA(policy::kMetricEnrollmentAccountDisabled); | 283 UMA(policy::kMetricEnrollmentAccountDisabled); |
| 285 LOG(ERROR) << "Account disabled " << error.state(); | 284 LOG(ERROR) << "Account disabled " << error.state(); |
| 286 break; | 285 break; |
| 287 case GoogleServiceAuthError::CONNECTION_FAILED: | 286 case GoogleServiceAuthError::CONNECTION_FAILED: |
| 288 case GoogleServiceAuthError::SERVICE_UNAVAILABLE: | 287 case GoogleServiceAuthError::SERVICE_UNAVAILABLE: |
| 289 UMA(policy::kMetricEnrollmentNetworkFailed); | 288 UMA(policy::kMetricEnrollmentNetworkFailed); |
| 290 LOG(WARNING) << "Network error " << error.state(); | 289 LOG(WARNING) << "Network error " << error.state(); |
| 291 break; | 290 break; |
| 291 case GoogleServiceAuthError::HOSTED_NOT_ALLOWED_DEPRECATED: |
| 292 case GoogleServiceAuthError::NUM_STATES: | 292 case GoogleServiceAuthError::NUM_STATES: |
| 293 NOTREACHED(); | 293 NOTREACHED(); |
| 294 break; | 294 break; |
| 295 } | 295 } |
| 296 } | 296 } |
| 297 | 297 |
| 298 void EnterpriseEnrollmentHelperImpl::ReportEnrollmentStatus( | 298 void EnterpriseEnrollmentHelperImpl::ReportEnrollmentStatus( |
| 299 policy::EnrollmentStatus status) { | 299 policy::EnrollmentStatus status) { |
| 300 switch (status.status()) { | 300 switch (status.status()) { |
| 301 case policy::EnrollmentStatus::STATUS_SUCCESS: | 301 case policy::EnrollmentStatus::STATUS_SUCCESS: |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 EnrollmentUMA(sample, enrollment_config_.mode); | 428 EnrollmentUMA(sample, enrollment_config_.mode); |
| 429 } | 429 } |
| 430 | 430 |
| 431 void EnterpriseEnrollmentHelperImpl::OnSigninProfileCleared( | 431 void EnterpriseEnrollmentHelperImpl::OnSigninProfileCleared( |
| 432 const base::Closure& callback) { | 432 const base::Closure& callback) { |
| 433 oauth_data_cleared_ = true; | 433 oauth_data_cleared_ = true; |
| 434 callback.Run(); | 434 callback.Run(); |
| 435 } | 435 } |
| 436 | 436 |
| 437 } // namespace chromeos | 437 } // namespace chromeos |
| OLD | NEW |