| 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/ui/webui/chromeos/login/reset_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/reset_screen_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 if (!page_is_ready()) { | 86 if (!page_is_ready()) { |
| 87 show_on_init_ = true; | 87 show_on_init_ = true; |
| 88 return; | 88 return; |
| 89 } | 89 } |
| 90 | 90 |
| 91 ChooseAndApplyShowScenario(); | 91 ChooseAndApplyShowScenario(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void ResetScreenHandler::ChooseAndApplyShowScenario() { | 94 void ResetScreenHandler::ChooseAndApplyShowScenario() { |
| 95 PrefService* prefs = g_browser_process->local_state(); | 95 PrefService* prefs = g_browser_process->local_state(); |
| 96 restart_required_ = !CommandLine::ForCurrentProcess()->HasSwitch( | 96 restart_required_ = !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 97 switches::kFirstExecAfterBoot); | 97 switches::kFirstExecAfterBoot); |
| 98 | 98 |
| 99 reboot_was_requested_ = false; | 99 reboot_was_requested_ = false; |
| 100 preparing_for_rollback_ = false; | 100 preparing_for_rollback_ = false; |
| 101 if (!restart_required_) // First exec after boot. | 101 if (!restart_required_) // First exec after boot. |
| 102 reboot_was_requested_ = prefs->GetBoolean(prefs::kFactoryResetRequested); | 102 reboot_was_requested_ = prefs->GetBoolean(prefs::kFactoryResetRequested); |
| 103 | 103 |
| 104 if (CommandLine::ForCurrentProcess()->HasSwitch( | 104 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 105 switches::kDisableRollbackOption)) { | 105 switches::kDisableRollbackOption)) { |
| 106 rollback_available_ = false; | 106 rollback_available_ = false; |
| 107 ShowWithParams(); | 107 ShowWithParams(); |
| 108 } else if (restart_required_) { | 108 } else if (restart_required_) { |
| 109 // Will require restart. | 109 // Will require restart. |
| 110 ShowWithParams(); | 110 ShowWithParams(); |
| 111 } else { | 111 } else { |
| 112 chromeos::DBusThreadManager::Get()->GetUpdateEngineClient()-> | 112 chromeos::DBusThreadManager::Get()->GetUpdateEngineClient()-> |
| 113 CanRollbackCheck(base::Bind(&ResetScreenHandler::OnRollbackCheck, | 113 CanRollbackCheck(base::Bind(&ResetScreenHandler::OnRollbackCheck, |
| 114 weak_ptr_factory_.GetWeakPtr())); | 114 weak_ptr_factory_.GetWeakPtr())); |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 base::DictionaryValue params; | 286 base::DictionaryValue params; |
| 287 params.SetInteger("uiState", kErrorUIStateRollback); | 287 params.SetInteger("uiState", kErrorUIStateRollback); |
| 288 ShowScreen(OobeUI::kScreenErrorMessage, ¶ms); | 288 ShowScreen(OobeUI::kScreenErrorMessage, ¶ms); |
| 289 } else if (status.status == | 289 } else if (status.status == |
| 290 UpdateEngineClient::UPDATE_STATUS_UPDATED_NEED_REBOOT) { | 290 UpdateEngineClient::UPDATE_STATUS_UPDATED_NEED_REBOOT) { |
| 291 DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart(); | 291 DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart(); |
| 292 } | 292 } |
| 293 } | 293 } |
| 294 | 294 |
| 295 } // namespace chromeos | 295 } // namespace chromeos |
| OLD | NEW |