| 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/supervised/supervised_user_creation_scre
en.h" | 5 #include "chrome/browser/chromeos/login/supervised/supervised_user_creation_scre
en.h" |
| 6 | 6 |
| 7 #include "base/rand_util.h" | 7 #include "base/rand_util.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/chromeos/camera_detector.h" | 9 #include "chrome/browser/chromeos/camera_detector.h" |
| 10 #include "chrome/browser/chromeos/login/error_screens_histogram_helper.h" | 10 #include "chrome/browser/chromeos/login/error_screens_histogram_helper.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 if (on_error_screen_) | 144 if (on_error_screen_) |
| 145 actor_->ShowPage(last_page_); | 145 actor_->ShowPage(last_page_); |
| 146 else | 146 else |
| 147 actor_->ShowIntroPage(); | 147 actor_->ShowIntroPage(); |
| 148 } | 148 } |
| 149 | 149 |
| 150 if (!on_error_screen_) | 150 if (!on_error_screen_) |
| 151 NetworkPortalDetector::Get()->AddAndFireObserver(this); | 151 NetworkPortalDetector::Get()->AddAndFireObserver(this); |
| 152 on_error_screen_ = false; | 152 on_error_screen_ = false; |
| 153 histogram_helper_->OnScreenShow(); | 153 histogram_helper_->OnScreenShow(); |
| 154 ash::Shell::GetInstance()->session_state_delegate()-> |
| 155 SetIsInSupervisedUserCreationFlow(true); |
| 154 } | 156 } |
| 155 | 157 |
| 156 void SupervisedUserCreationScreen::OnPageSelected(const std::string& page) { | 158 void SupervisedUserCreationScreen::OnPageSelected(const std::string& page) { |
| 157 last_page_ = page; | 159 last_page_ = page; |
| 158 } | 160 } |
| 159 | 161 |
| 160 void SupervisedUserCreationScreen::OnPortalDetectionCompleted( | 162 void SupervisedUserCreationScreen::OnPortalDetectionCompleted( |
| 161 const NetworkState* network, | 163 const NetworkState* network, |
| 162 const NetworkPortalDetector::CaptivePortalState& state) { | 164 const NetworkPortalDetector::CaptivePortalState& state) { |
| 163 if (state.status == NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE) { | 165 if (state.status == NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 | 203 |
| 202 std::string SupervisedUserCreationScreen::GetName() const { | 204 std::string SupervisedUserCreationScreen::GetName() const { |
| 203 return WizardController::kSupervisedUserCreationScreenName; | 205 return WizardController::kSupervisedUserCreationScreenName; |
| 204 } | 206 } |
| 205 | 207 |
| 206 void SupervisedUserCreationScreen::AbortFlow() { | 208 void SupervisedUserCreationScreen::AbortFlow() { |
| 207 DBusThreadManager::Get() | 209 DBusThreadManager::Get() |
| 208 ->GetSessionManagerClient() | 210 ->GetSessionManagerClient() |
| 209 ->NotifySupervisedUserCreationFinished(); | 211 ->NotifySupervisedUserCreationFinished(); |
| 210 controller_->CancelCreation(); | 212 controller_->CancelCreation(); |
| 213 ash::Shell::GetInstance()->session_state_delegate()-> |
| 214 SetIsInSupervisedUserCreationFlow(false); |
| 211 } | 215 } |
| 212 | 216 |
| 213 void SupervisedUserCreationScreen::FinishFlow() { | 217 void SupervisedUserCreationScreen::FinishFlow() { |
| 214 DBusThreadManager::Get() | 218 DBusThreadManager::Get() |
| 215 ->GetSessionManagerClient() | 219 ->GetSessionManagerClient() |
| 216 ->NotifySupervisedUserCreationFinished(); | 220 ->NotifySupervisedUserCreationFinished(); |
| 217 controller_->FinishCreation(); | 221 controller_->FinishCreation(); |
| 222 ash::Shell::GetInstance()->session_state_delegate()-> |
| 223 SetIsInSupervisedUserCreationFlow(false); |
| 218 } | 224 } |
| 219 | 225 |
| 220 void SupervisedUserCreationScreen::AuthenticateManager( | 226 void SupervisedUserCreationScreen::AuthenticateManager( |
| 221 const std::string& manager_id, | 227 const std::string& manager_id, |
| 222 const std::string& manager_password) { | 228 const std::string& manager_password) { |
| 223 if (manager_signin_in_progress_) | 229 if (manager_signin_in_progress_) |
| 224 return; | 230 return; |
| 225 manager_signin_in_progress_ = true; | 231 manager_signin_in_progress_ = true; |
| 226 | 232 |
| 227 UserFlow* flow = new SupervisedUserCreationFlow(manager_id); | 233 UserFlow* flow = new SupervisedUserCreationFlow(manager_id); |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 selected_image_ = user_manager::User::USER_IMAGE_EXTERNAL; | 641 selected_image_ = user_manager::User::USER_IMAGE_EXTERNAL; |
| 636 } else { | 642 } else { |
| 637 NOTREACHED() << "Unexpected image type: " << image_type; | 643 NOTREACHED() << "Unexpected image type: " << image_type; |
| 638 } | 644 } |
| 639 } | 645 } |
| 640 | 646 |
| 641 void SupervisedUserCreationScreen::OnImageAccepted() { | 647 void SupervisedUserCreationScreen::OnImageAccepted() { |
| 642 } | 648 } |
| 643 | 649 |
| 644 } // namespace chromeos | 650 } // namespace chromeos |
| OLD | NEW |