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

Unified Diff: chrome/browser/chromeos/login/screens/host_pairing_screen.cc

Issue 547503002: Redirect to the enterprise enrollment screen during remora and shark pairing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review fixes Created 6 years, 3 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
Index: chrome/browser/chromeos/login/screens/host_pairing_screen.cc
diff --git a/chrome/browser/chromeos/login/screens/host_pairing_screen.cc b/chrome/browser/chromeos/login/screens/host_pairing_screen.cc
index 075297391b3f62223d60fdbed105b71056f96a0f..f02a213d7c293cee6178d794c98d6853aa07ab1f 100644
--- a/chrome/browser/chromeos/login/screens/host_pairing_screen.cc
+++ b/chrome/browser/chromeos/login/screens/host_pairing_screen.cc
@@ -20,6 +20,7 @@ HostPairingScreen::HostPairingScreen(
: WizardScreen(observer),
actor_(actor),
controller_(controller),
+ observing_controller_(true),
current_stage_(HostPairingController::STAGE_NONE) {
actor_->SetDelegate(this);
controller_->AddObserver(this);
@@ -28,7 +29,8 @@ HostPairingScreen::HostPairingScreen(
HostPairingScreen::~HostPairingScreen() {
if (actor_)
actor_->SetDelegate(NULL);
- controller_->RemoveObserver(this);
+ if (observing_controller_)
+ controller_->RemoveObserver(this);
}
void HostPairingScreen::CommitContextChanges() {
@@ -63,6 +65,10 @@ void HostPairingScreen::PairingStageChanged(Stage new_stage) {
std::string desired_page;
switch (new_stage) {
+ case HostPairingController::STAGE_NONE:
+ case HostPairingController::STAGE_INITIALIZATION_ERROR: {
+ break;
+ }
case HostPairingController::STAGE_WAITING_FOR_CONTROLLER:
case HostPairingController::STAGE_WAITING_FOR_CONTROLLER_AFTER_UPDATE: {
desired_page = kPageWelcome;
@@ -98,11 +104,7 @@ void HostPairingScreen::PairingStageChanged(Stage new_stage) {
break;
}
case HostPairingController::STAGE_FINISHED: {
- get_screen_observer()->OnExit(WizardController::HOST_PAIRING_FINISHED);
- break;
- }
- default: {
- NOTREACHED();
+ // This page is closed in EnrollHost.
break;
}
}
@@ -122,9 +124,11 @@ void HostPairingScreen::ConfigureHost(bool accepted_eula,
}
void HostPairingScreen::EnrollHost(const std::string& auth_token) {
- // TODO(zork,achuith): Enroll device, send error on error.
- // (http://crbug.com/374990)
- controller_->SetEnrollmentComplete(true);
+ DCHECK(observing_controller_);
+ observing_controller_ = false;
+ controller_->RemoveObserver(this);
+ WizardController::default_controller()->OnEnrollmentAuthTokenReceived(
+ auth_token);
}
void HostPairingScreen::OnActorDestroyed(HostPairingScreenActor* actor) {

Powered by Google App Engine
This is Rietveld 408576698