| 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/screens/host_pairing_screen.h" | 5 #include "chrome/browser/chromeos/login/screens/host_pairing_screen.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/chromeos/login/startup_utils.h" | 9 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 10 #include "chrome/browser/chromeos/login/wizard_controller.h" | 10 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 g_browser_process->platform_part() | 145 g_browser_process->platform_part() |
| 146 ->browser_policy_connector_chromeos() | 146 ->browser_policy_connector_chromeos() |
| 147 ->GetPrescribedEnrollmentConfig(); | 147 ->GetPrescribedEnrollmentConfig(); |
| 148 enrollment_helper_ = EnterpriseEnrollmentHelper::Create( | 148 enrollment_helper_ = EnterpriseEnrollmentHelper::Create( |
| 149 this, nullptr, enrollment_config, std::string()); | 149 this, nullptr, enrollment_config, std::string()); |
| 150 enrollment_helper_->EnrollUsingToken(auth_token); | 150 enrollment_helper_->EnrollUsingToken(auth_token); |
| 151 remora_controller_->OnEnrollmentStatusChanged( | 151 remora_controller_->OnEnrollmentStatusChanged( |
| 152 HostPairingController::ENROLLMENT_STATUS_ENROLLING); | 152 HostPairingController::ENROLLMENT_STATUS_ENROLLING); |
| 153 } | 153 } |
| 154 | 154 |
| 155 void HostPairingScreen::RebootHostRequested() { |
| 156 if (delegate_) |
| 157 delegate_->RebootHostRequested(); |
| 158 } |
| 159 |
| 155 void HostPairingScreen::OnViewDestroyed(HostPairingScreenView* view) { | 160 void HostPairingScreen::OnViewDestroyed(HostPairingScreenView* view) { |
| 156 if (view_ == view) | 161 if (view_ == view) |
| 157 view_ = NULL; | 162 view_ = NULL; |
| 158 } | 163 } |
| 159 | 164 |
| 160 void HostPairingScreen::OnAuthError(const GoogleServiceAuthError& error) { | 165 void HostPairingScreen::OnAuthError(const GoogleServiceAuthError& error) { |
| 161 enrollment_error_string_ = view_->GetErrorStringFromAuthError(error); | 166 enrollment_error_string_ = view_->GetErrorStringFromAuthError(error); |
| 162 OnAnyEnrollmentError(); | 167 OnAnyEnrollmentError(); |
| 163 } | 168 } |
| 164 | 169 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 } | 202 } |
| 198 | 203 |
| 199 void HostPairingScreen::OnAnyEnrollmentError() { | 204 void HostPairingScreen::OnAnyEnrollmentError() { |
| 200 enrollment_helper_->ClearAuth(base::Bind(&HostPairingScreen::OnAuthCleared, | 205 enrollment_helper_->ClearAuth(base::Bind(&HostPairingScreen::OnAuthCleared, |
| 201 weak_ptr_factory_.GetWeakPtr())); | 206 weak_ptr_factory_.GetWeakPtr())); |
| 202 remora_controller_->OnEnrollmentStatusChanged( | 207 remora_controller_->OnEnrollmentStatusChanged( |
| 203 HostPairingController::ENROLLMENT_STATUS_FAILURE); | 208 HostPairingController::ENROLLMENT_STATUS_FAILURE); |
| 204 } | 209 } |
| 205 | 210 |
| 206 } // namespace chromeos | 211 } // namespace chromeos |
| OLD | NEW |