| 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/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 break; | 358 break; |
| 359 case policy::EnrollmentStatus::STATUS_ROBOT_REFRESH_STORE_FAILED: | 359 case policy::EnrollmentStatus::STATUS_ROBOT_REFRESH_STORE_FAILED: |
| 360 UMA(policy::kMetricEnrollmentRobotRefreshTokenStoreFailed); | 360 UMA(policy::kMetricEnrollmentRobotRefreshTokenStoreFailed); |
| 361 break; | 361 break; |
| 362 case policy::EnrollmentStatus::STATUS_STORE_TOKEN_AND_ID_FAILED: | 362 case policy::EnrollmentStatus::STATUS_STORE_TOKEN_AND_ID_FAILED: |
| 363 // This error should not happen for enterprise enrollment, it only affects | 363 // This error should not happen for enterprise enrollment, it only affects |
| 364 // consumer enrollment. | 364 // consumer enrollment. |
| 365 UMA(policy::kMetricEnrollmentStoreTokenAndIdFailed); | 365 UMA(policy::kMetricEnrollmentStoreTokenAndIdFailed); |
| 366 NOTREACHED(); | 366 NOTREACHED(); |
| 367 break; | 367 break; |
| 368 case policy::EnrollmentStatus::STATUS_DEVICE_NAMING_FAILED: |
| 369 UMA(policy::kMetricEnrollmentDeviceNamingFailed); |
| 370 break; |
| 368 } | 371 } |
| 369 } | 372 } |
| 370 | 373 |
| 371 void EnterpriseEnrollmentHelperImpl::UMA(policy::MetricEnrollment sample) { | 374 void EnterpriseEnrollmentHelperImpl::UMA(policy::MetricEnrollment sample) { |
| 372 EnrollmentUMA(sample, enrollment_config_.mode); | 375 EnrollmentUMA(sample, enrollment_config_.mode); |
| 373 } | 376 } |
| 374 | 377 |
| 375 void EnterpriseEnrollmentHelperImpl::OnBrowsingDataRemoverDone() { | 378 void EnterpriseEnrollmentHelperImpl::OnBrowsingDataRemoverDone() { |
| 376 browsing_data_remover_->RemoveObserver(this); | 379 browsing_data_remover_->RemoveObserver(this); |
| 377 browsing_data_remover_ = NULL; | 380 browsing_data_remover_ = NULL; |
| 378 auth_data_cleared_ = true; | 381 auth_data_cleared_ = true; |
| 379 | 382 |
| 380 std::vector<base::Closure> callbacks_to_run; | 383 std::vector<base::Closure> callbacks_to_run; |
| 381 callbacks_to_run.swap(auth_clear_callbacks_); | 384 callbacks_to_run.swap(auth_clear_callbacks_); |
| 382 for (std::vector<base::Closure>::iterator callback(callbacks_to_run.begin()); | 385 for (std::vector<base::Closure>::iterator callback(callbacks_to_run.begin()); |
| 383 callback != callbacks_to_run.end(); | 386 callback != callbacks_to_run.end(); |
| 384 ++callback) { | 387 ++callback) { |
| 385 callback->Run(); | 388 callback->Run(); |
| 386 } | 389 } |
| 387 } | 390 } |
| 388 | 391 |
| 389 } // namespace chromeos | 392 } // namespace chromeos |
| OLD | NEW |