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

Unified Diff: chrome/browser/chromeos/login/update_screen.cc

Issue 5366004: [cros] Make sure that update screen will be skipped when shortcut is pressed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month 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
« no previous file with comments | « chrome/browser/chromeos/login/update_screen.h ('k') | chrome/browser/chromeos/login/wizard_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/update_screen.cc
diff --git a/chrome/browser/chromeos/login/update_screen.cc b/chrome/browser/chromeos/login/update_screen.cc
index f3f5ef8e57543becc645f4e57d15c825b8d6de88..49b67d81e3979eee5b990984ccc1c5ec81caa0d1 100644
--- a/chrome/browser/chromeos/login/update_screen.cc
+++ b/chrome/browser/chromeos/login/update_screen.cc
@@ -68,12 +68,12 @@ void UpdateScreen::UpdateStatusChanged(UpdateLibrary* library) {
case UPDATE_STATUS_UPDATE_AVAILABLE:
view()->SetProgress(kBeforeDownloadProgress);
if (!HasCriticalUpdate()) {
- VLOG(1) << "Noncritical update available: "
- << library->status().new_version;
- ExitUpdate();
+ LOG(INFO) << "Noncritical update available: "
+ << library->status().new_version;
+ ExitUpdate(false);
} else {
- VLOG(1) << "Critical update available: "
- << library->status().new_version;
+ LOG(INFO) << "Critical update available: "
+ << library->status().new_version;
}
break;
case UPDATE_STATUS_DOWNLOADING:
@@ -83,12 +83,12 @@ void UpdateScreen::UpdateStatusChanged(UpdateLibrary* library) {
// we need to is update critical on first downloading notification.
is_downloading_update_ = true;
if (!HasCriticalUpdate()) {
- VLOG(1) << "Non-critical update available: "
- << library->status().new_version;
- ExitUpdate();
+ LOG(INFO) << "Non-critical update available: "
+ << library->status().new_version;
+ ExitUpdate(false);
} else {
- VLOG(1) << "Critical update available: "
- << library->status().new_version;
+ LOG(INFO) << "Critical update available: "
+ << library->status().new_version;
}
}
view()->ShowCurtain(false);
@@ -115,13 +115,13 @@ void UpdateScreen::UpdateStatusChanged(UpdateLibrary* library) {
this,
&UpdateScreen::OnWaitForRebootTimeElapsed);
} else {
- ExitUpdate();
+ ExitUpdate(false);
}
break;
case UPDATE_STATUS_IDLE:
case UPDATE_STATUS_ERROR:
case UPDATE_STATUS_REPORTING_ERROR_EVENT:
- ExitUpdate();
+ ExitUpdate(false);
break;
default:
NOTREACHED();
@@ -153,7 +153,7 @@ void UpdateScreen::StartUpdate() {
CrosLibrary::Get()->GetUpdateLibrary()->AddObserver(this);
VLOG(1) << "Initiate update check";
if (!CrosLibrary::Get()->GetUpdateLibrary()->CheckForUpdate()) {
- ExitUpdate();
+ ExitUpdate(true);
}
}
}
@@ -162,15 +162,21 @@ void UpdateScreen::CancelUpdate() {
// Screen has longer lifetime than it's view.
// View is deleted after wizard proceeds to the next screen.
if (view())
- ExitUpdate();
+ ExitUpdate(true);
}
-void UpdateScreen::ExitUpdate() {
+void UpdateScreen::ExitUpdate(bool forced) {
maximal_curtain_time_timer_.Stop();
ScreenObserver* observer = delegate()->GetObserver(this);
if (!CrosLibrary::Get()->EnsureLoaded()) {
observer->OnExit(ScreenObserver::UPDATE_ERROR_CHECKING_FOR_UPDATE);
+ return;
+ }
+
+ if (forced) {
+ observer->OnExit(ScreenObserver::UPDATE_NOUPDATE);
+ return;
}
UpdateLibrary* update_library = CrosLibrary::Get()->GetUpdateLibrary();
@@ -179,6 +185,8 @@ void UpdateScreen::ExitUpdate() {
case UPDATE_STATUS_UPDATE_AVAILABLE:
case UPDATE_STATUS_UPDATED_NEED_REBOOT:
case UPDATE_STATUS_DOWNLOADING:
+ case UPDATE_STATUS_FINALIZING:
+ case UPDATE_STATUS_VERIFYING:
DCHECK(!HasCriticalUpdate());
// Noncritical update, just exit screen as if there is no update.
// no break
« no previous file with comments | « chrome/browser/chromeos/login/update_screen.h ('k') | chrome/browser/chromeos/login/wizard_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698