| 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/wizard_controller.h" | 5 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 6 | 6 |
| 7 #include <signal.h> | 7 #include <signal.h> |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 #include <sys/types.h> | 9 #include <sys/types.h> |
| 10 | 10 |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 AdvanceToScreen(first_screen_name_); | 277 AdvanceToScreen(first_screen_name_); |
| 278 if (!IsMachineHWIDCorrect() && !StartupUtils::IsDeviceRegistered() && | 278 if (!IsMachineHWIDCorrect() && !StartupUtils::IsDeviceRegistered() && |
| 279 first_screen_name_.empty()) | 279 first_screen_name_.empty()) |
| 280 ShowWrongHWIDScreen(); | 280 ShowWrongHWIDScreen(); |
| 281 } | 281 } |
| 282 | 282 |
| 283 chromeos::ErrorScreen* WizardController::GetErrorScreen() { | 283 chromeos::ErrorScreen* WizardController::GetErrorScreen() { |
| 284 return static_cast<chromeos::ErrorScreen*>(GetScreen(kErrorScreenName)); | 284 return static_cast<chromeos::ErrorScreen*>(GetScreen(kErrorScreenName)); |
| 285 } | 285 } |
| 286 | 286 |
| 287 WizardScreen* WizardController::CreateScreen(const std::string& screen_name) { | 287 BaseScreen* WizardController::CreateScreen(const std::string& screen_name) { |
| 288 if (screen_name == kNetworkScreenName) { | 288 if (screen_name == kNetworkScreenName) { |
| 289 return new chromeos::NetworkScreen(this, | 289 return new chromeos::NetworkScreen(this, |
| 290 oobe_display_->GetNetworkScreenActor()); | 290 oobe_display_->GetNetworkScreenActor()); |
| 291 } else if (screen_name == kErrorScreenName) { | 291 } else if (screen_name == kErrorScreenName) { |
| 292 return new chromeos::ErrorScreen(this, | 292 return new chromeos::ErrorScreen(this, |
| 293 oobe_display_->GetErrorScreenActor()); | 293 oobe_display_->GetErrorScreenActor()); |
| 294 } else if (screen_name == kUpdateScreenName) { | 294 } else if (screen_name == kUpdateScreenName) { |
| 295 chromeos::UpdateScreen* result = | 295 chromeos::UpdateScreen* result = |
| 296 new chromeos::UpdateScreen(this, | 296 new chromeos::UpdateScreen(this, |
| 297 oobe_display_->GetUpdateScreenActor(), | 297 oobe_display_->GetUpdateScreenActor(), |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 UMA_HISTOGRAM_COUNTS_100( | 787 UMA_HISTOGRAM_COUNTS_100( |
| 788 "HIDDetection.TimesDialogShownPerOOBECompleted", | 788 "HIDDetection.TimesDialogShownPerOOBECompleted", |
| 789 GetLocalState()->GetInteger(prefs::kTimesHIDDialogShown)); | 789 GetLocalState()->GetInteger(prefs::kTimesHIDDialogShown)); |
| 790 GetLocalState()->ClearPref(prefs::kTimesHIDDialogShown); | 790 GetLocalState()->ClearPref(prefs::kTimesHIDDialogShown); |
| 791 StartupUtils::MarkOobeCompleted(); | 791 StartupUtils::MarkOobeCompleted(); |
| 792 | 792 |
| 793 if (enrollment_recovery_) | 793 if (enrollment_recovery_) |
| 794 chrome::AttemptRestart(); | 794 chrome::AttemptRestart(); |
| 795 } | 795 } |
| 796 | 796 |
| 797 void WizardController::SetCurrentScreen(WizardScreen* new_current) { | 797 void WizardController::SetCurrentScreen(BaseScreen* new_current) { |
| 798 SetCurrentScreenSmooth(new_current, false); | 798 SetCurrentScreenSmooth(new_current, false); |
| 799 } | 799 } |
| 800 | 800 |
| 801 void WizardController::ShowCurrentScreen() { | 801 void WizardController::ShowCurrentScreen() { |
| 802 // ShowCurrentScreen may get called by smooth_show_timer_ even after | 802 // ShowCurrentScreen may get called by smooth_show_timer_ even after |
| 803 // flow has been switched to sign in screen (ExistingUserController). | 803 // flow has been switched to sign in screen (ExistingUserController). |
| 804 if (!oobe_display_) | 804 if (!oobe_display_) |
| 805 return; | 805 return; |
| 806 | 806 |
| 807 // First remember how far have we reached so that we can resume if needed. | 807 // First remember how far have we reached so that we can resume if needed. |
| 808 if (is_out_of_box_ && IsResumableScreen(current_screen_->GetName())) | 808 if (is_out_of_box_ && IsResumableScreen(current_screen_->GetName())) |
| 809 StartupUtils::SaveOobePendingScreen(current_screen_->GetName()); | 809 StartupUtils::SaveOobePendingScreen(current_screen_->GetName()); |
| 810 | 810 |
| 811 smooth_show_timer_.Stop(); | 811 smooth_show_timer_.Stop(); |
| 812 | 812 |
| 813 FOR_EACH_OBSERVER(Observer, observer_list_, OnScreenChanged(current_screen_)); | 813 FOR_EACH_OBSERVER(Observer, observer_list_, OnScreenChanged(current_screen_)); |
| 814 | 814 |
| 815 current_screen_->Show(); | 815 current_screen_->Show(); |
| 816 } | 816 } |
| 817 | 817 |
| 818 void WizardController::SetCurrentScreenSmooth(WizardScreen* new_current, | 818 void WizardController::SetCurrentScreenSmooth(BaseScreen* new_current, |
| 819 bool use_smoothing) { | 819 bool use_smoothing) { |
| 820 if (current_screen_ == new_current || | 820 if (current_screen_ == new_current || |
| 821 new_current == NULL || | 821 new_current == NULL || |
| 822 oobe_display_ == NULL) { | 822 oobe_display_ == NULL) { |
| 823 return; | 823 return; |
| 824 } | 824 } |
| 825 | 825 |
| 826 smooth_show_timer_.Stop(); | 826 smooth_show_timer_.Stop(); |
| 827 | 827 |
| 828 if (current_screen_) | 828 if (current_screen_) |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 | 1012 |
| 1013 bool WizardController::GetUsageStatisticsReporting() const { | 1013 bool WizardController::GetUsageStatisticsReporting() const { |
| 1014 return usage_statistics_reporting_; | 1014 return usage_statistics_reporting_; |
| 1015 } | 1015 } |
| 1016 | 1016 |
| 1017 void WizardController::ShowErrorScreen() { | 1017 void WizardController::ShowErrorScreen() { |
| 1018 VLOG(1) << "Showing error screen."; | 1018 VLOG(1) << "Showing error screen."; |
| 1019 SetCurrentScreen(GetScreen(kErrorScreenName)); | 1019 SetCurrentScreen(GetScreen(kErrorScreenName)); |
| 1020 } | 1020 } |
| 1021 | 1021 |
| 1022 void WizardController::HideErrorScreen(WizardScreen* parent_screen) { | 1022 void WizardController::HideErrorScreen(BaseScreen* parent_screen) { |
| 1023 DCHECK(parent_screen); | 1023 DCHECK(parent_screen); |
| 1024 VLOG(1) << "Hiding error screen."; | 1024 VLOG(1) << "Hiding error screen."; |
| 1025 SetCurrentScreen(parent_screen); | 1025 SetCurrentScreen(parent_screen); |
| 1026 } | 1026 } |
| 1027 | 1027 |
| 1028 void WizardController::OnAccessibilityStatusChanged( | 1028 void WizardController::OnAccessibilityStatusChanged( |
| 1029 const AccessibilityStatusEventDetails& details) { | 1029 const AccessibilityStatusEventDetails& details) { |
| 1030 enum AccessibilityNotificationType type = details.notification_type; | 1030 enum AccessibilityNotificationType type = details.notification_type; |
| 1031 if (type == ACCESSIBILITY_MANAGER_SHUTDOWN) { | 1031 if (type == ACCESSIBILITY_MANAGER_SHUTDOWN) { |
| 1032 accessibility_subscription_.reset(); | 1032 accessibility_subscription_.reset(); |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1254 scoped_ptr<pairing_chromeos::HostPairingController> remora_controller) { | 1254 scoped_ptr<pairing_chromeos::HostPairingController> remora_controller) { |
| 1255 VLOG(1) << "OnSharkConnected"; | 1255 VLOG(1) << "OnSharkConnected"; |
| 1256 remora_controller_ = remora_controller.Pass(); | 1256 remora_controller_ = remora_controller.Pass(); |
| 1257 base::MessageLoop::current()->DeleteSoon( | 1257 base::MessageLoop::current()->DeleteSoon( |
| 1258 FROM_HERE, shark_connection_listener_.release()); | 1258 FROM_HERE, shark_connection_listener_.release()); |
| 1259 shark_controller_detected_ = true; | 1259 shark_controller_detected_ = true; |
| 1260 ShowHostPairingScreen(); | 1260 ShowHostPairingScreen(); |
| 1261 } | 1261 } |
| 1262 | 1262 |
| 1263 } // namespace chromeos | 1263 } // namespace chromeos |
| OLD | NEW |