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

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/reset_screen_handler.cc

Issue 216883004: Browsertests for improved reset options: powerwash and rollback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Unused js API removed. Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 void ResetScreenHandler::HandleOnRestart(bool should_rollback) { 192 void ResetScreenHandler::HandleOnRestart(bool should_rollback) {
193 PrefService* prefs = g_browser_process->local_state(); 193 PrefService* prefs = g_browser_process->local_state();
194 prefs->SetBoolean(prefs::kFactoryResetRequested, true); 194 prefs->SetBoolean(prefs::kFactoryResetRequested, true);
195 prefs->SetBoolean(prefs::kRollbackRequested, should_rollback); 195 prefs->SetBoolean(prefs::kRollbackRequested, should_rollback);
196 prefs->CommitPendingWrite(); 196 prefs->CommitPendingWrite();
197 197
198 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart(); 198 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart();
199 } 199 }
200 200
201 void ResetScreenHandler::HandleOnPowerwash(bool rollback_checked) { 201 void ResetScreenHandler::HandleOnPowerwash(bool rollback_checked) {
202 if (rollback_checked && rollback_available_) { 202 if (rollback_available_ && (rollback_checked || reboot_was_requested_)) {
203 chromeos::DBusThreadManager::Get()->GetUpdateEngineClient()->Rollback(); 203 chromeos::DBusThreadManager::Get()->GetUpdateEngineClient()->Rollback();
204 } else { 204 } else {
205 if (rollback_checked) 205 if (rollback_checked && !rollback_available_)
206 NOTREACHED() << 206 NOTREACHED() <<
207 "Rollback was checked but not available. Starting powerwash."; 207 "Rollback was checked but not available. Starting powerwash.";
208 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> 208 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()->
209 StartDeviceWipe(); 209 StartDeviceWipe();
210 } 210 }
211 } 211 }
212 212
213 void ResetScreenHandler::HandleOnLearnMore() { 213 void ResetScreenHandler::HandleOnLearnMore() {
214 if (!help_app_.get()) 214 if (!help_app_.get())
215 help_app_ = new HelpAppLauncher(GetNativeWindow()); 215 help_app_ = new HelpAppLauncher(GetNativeWindow());
216 help_app_->ShowHelpTopic(HelpAppLauncher::HELP_POWERWASH); 216 help_app_->ShowHelpTopic(HelpAppLauncher::HELP_POWERWASH);
217 } 217 }
218 218
219 } // namespace chromeos 219 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698