| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/enrollment_screen.h" | 5 #include "chrome/browser/chromeos/login/enrollment/enrollment_screen.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 enrollment_helper_->ClearAuth(base::Bind(&EnrollmentScreen::OnAuthCleared, | 134 enrollment_helper_->ClearAuth(base::Bind(&EnrollmentScreen::OnAuthCleared, |
| 135 weak_ptr_factory_.GetWeakPtr(), | 135 weak_ptr_factory_.GetWeakPtr(), |
| 136 callback)); | 136 callback)); |
| 137 } | 137 } |
| 138 | 138 |
| 139 void EnrollmentScreen::OnAuthCleared(const base::Closure& callback) { | 139 void EnrollmentScreen::OnAuthCleared(const base::Closure& callback) { |
| 140 enrollment_helper_ = nullptr; | 140 enrollment_helper_ = nullptr; |
| 141 callback.Run(); | 141 callback.Run(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 void EnrollmentScreen::PrepareToShow() { | |
| 145 actor_->PrepareToShow(); | |
| 146 } | |
| 147 | |
| 148 void EnrollmentScreen::Show() { | 144 void EnrollmentScreen::Show() { |
| 149 UMA(policy::kMetricEnrollmentTriggered); | 145 UMA(policy::kMetricEnrollmentTriggered); |
| 150 switch (current_auth_) { | 146 switch (current_auth_) { |
| 151 case AUTH_OAUTH: | 147 case AUTH_OAUTH: |
| 152 ShowInteractiveScreen(); | 148 ShowInteractiveScreen(); |
| 153 break; | 149 break; |
| 154 case AUTH_ATTESTATION: | 150 case AUTH_ATTESTATION: |
| 155 AuthenticateUsingAttestation(); | 151 AuthenticateUsingAttestation(); |
| 156 break; | 152 break; |
| 157 default: | 153 default: |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 } | 343 } |
| 348 | 344 |
| 349 void EnrollmentScreen::RecordEnrollmentErrorMetrics() { | 345 void EnrollmentScreen::RecordEnrollmentErrorMetrics() { |
| 350 enrollment_failed_once_ = true; | 346 enrollment_failed_once_ = true; |
| 351 // TODO(drcrash): Maybe create multiple metrics (http://crbug.com/640313)? | 347 // TODO(drcrash): Maybe create multiple metrics (http://crbug.com/640313)? |
| 352 if (elapsed_timer_) | 348 if (elapsed_timer_) |
| 353 UMA_ENROLLMENT_TIME(kMetricEnrollmentTimeFailure, elapsed_timer_); | 349 UMA_ENROLLMENT_TIME(kMetricEnrollmentTimeFailure, elapsed_timer_); |
| 354 } | 350 } |
| 355 | 351 |
| 356 } // namespace chromeos | 352 } // namespace chromeos |
| OLD | NEW |