Skip to content
Snippets Groups Projects
Commit 91abc359 authored by nkostylev@chromium.org's avatar nkostylev@chromium.org
Browse files

[cros] Make sure that update screen will be skipped when shortcut is pressed.

Converted some important logging to LOG(INFO).

See similar CL to branch
http://codereview.chromium.org/5291010/

Had to make 2 copies because update_screen.cc has been changed in trunk.

BUG=chromium-os:9654
TEST=Manual

Review URL: http://codereview.chromium.org/5366004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67731 0039d316-1c4b-4281-b951-d872f2087c98
parent 7b339027
No related branches found
No related tags found
No related merge requests found
...@@ -68,12 +68,12 @@ void UpdateScreen::UpdateStatusChanged(UpdateLibrary* library) { ...@@ -68,12 +68,12 @@ void UpdateScreen::UpdateStatusChanged(UpdateLibrary* library) {
case UPDATE_STATUS_UPDATE_AVAILABLE: case UPDATE_STATUS_UPDATE_AVAILABLE:
view()->SetProgress(kBeforeDownloadProgress); view()->SetProgress(kBeforeDownloadProgress);
if (!HasCriticalUpdate()) { if (!HasCriticalUpdate()) {
VLOG(1) << "Noncritical update available: " LOG(INFO) << "Noncritical update available: "
<< library->status().new_version; << library->status().new_version;
ExitUpdate(); ExitUpdate(false);
} else { } else {
VLOG(1) << "Critical update available: " LOG(INFO) << "Critical update available: "
<< library->status().new_version; << library->status().new_version;
} }
break; break;
case UPDATE_STATUS_DOWNLOADING: case UPDATE_STATUS_DOWNLOADING:
...@@ -83,12 +83,12 @@ void UpdateScreen::UpdateStatusChanged(UpdateLibrary* library) { ...@@ -83,12 +83,12 @@ void UpdateScreen::UpdateStatusChanged(UpdateLibrary* library) {
// we need to is update critical on first downloading notification. // we need to is update critical on first downloading notification.
is_downloading_update_ = true; is_downloading_update_ = true;
if (!HasCriticalUpdate()) { if (!HasCriticalUpdate()) {
VLOG(1) << "Non-critical update available: " LOG(INFO) << "Non-critical update available: "
<< library->status().new_version; << library->status().new_version;
ExitUpdate(); ExitUpdate(false);
} else { } else {
VLOG(1) << "Critical update available: " LOG(INFO) << "Critical update available: "
<< library->status().new_version; << library->status().new_version;
} }
} }
view()->ShowCurtain(false); view()->ShowCurtain(false);
...@@ -115,13 +115,13 @@ void UpdateScreen::UpdateStatusChanged(UpdateLibrary* library) { ...@@ -115,13 +115,13 @@ void UpdateScreen::UpdateStatusChanged(UpdateLibrary* library) {
this, this,
&UpdateScreen::OnWaitForRebootTimeElapsed); &UpdateScreen::OnWaitForRebootTimeElapsed);
} else { } else {
ExitUpdate(); ExitUpdate(false);
} }
break; break;
case UPDATE_STATUS_IDLE: case UPDATE_STATUS_IDLE:
case UPDATE_STATUS_ERROR: case UPDATE_STATUS_ERROR:
case UPDATE_STATUS_REPORTING_ERROR_EVENT: case UPDATE_STATUS_REPORTING_ERROR_EVENT:
ExitUpdate(); ExitUpdate(false);
break; break;
default: default:
NOTREACHED(); NOTREACHED();
...@@ -153,7 +153,7 @@ void UpdateScreen::StartUpdate() { ...@@ -153,7 +153,7 @@ void UpdateScreen::StartUpdate() {
CrosLibrary::Get()->GetUpdateLibrary()->AddObserver(this); CrosLibrary::Get()->GetUpdateLibrary()->AddObserver(this);
VLOG(1) << "Initiate update check"; VLOG(1) << "Initiate update check";
if (!CrosLibrary::Get()->GetUpdateLibrary()->CheckForUpdate()) { if (!CrosLibrary::Get()->GetUpdateLibrary()->CheckForUpdate()) {
ExitUpdate(); ExitUpdate(true);
} }
} }
} }
...@@ -162,15 +162,21 @@ void UpdateScreen::CancelUpdate() { ...@@ -162,15 +162,21 @@ void UpdateScreen::CancelUpdate() {
// Screen has longer lifetime than it's view. // Screen has longer lifetime than it's view.
// View is deleted after wizard proceeds to the next screen. // View is deleted after wizard proceeds to the next screen.
if (view()) if (view())
ExitUpdate(); ExitUpdate(true);
} }
void UpdateScreen::ExitUpdate() { void UpdateScreen::ExitUpdate(bool forced) {
maximal_curtain_time_timer_.Stop(); maximal_curtain_time_timer_.Stop();
ScreenObserver* observer = delegate()->GetObserver(this); ScreenObserver* observer = delegate()->GetObserver(this);
if (!CrosLibrary::Get()->EnsureLoaded()) { if (!CrosLibrary::Get()->EnsureLoaded()) {
observer->OnExit(ScreenObserver::UPDATE_ERROR_CHECKING_FOR_UPDATE); observer->OnExit(ScreenObserver::UPDATE_ERROR_CHECKING_FOR_UPDATE);
return;
}
if (forced) {
observer->OnExit(ScreenObserver::UPDATE_NOUPDATE);
return;
} }
UpdateLibrary* update_library = CrosLibrary::Get()->GetUpdateLibrary(); UpdateLibrary* update_library = CrosLibrary::Get()->GetUpdateLibrary();
...@@ -179,6 +185,8 @@ void UpdateScreen::ExitUpdate() { ...@@ -179,6 +185,8 @@ void UpdateScreen::ExitUpdate() {
case UPDATE_STATUS_UPDATE_AVAILABLE: case UPDATE_STATUS_UPDATE_AVAILABLE:
case UPDATE_STATUS_UPDATED_NEED_REBOOT: case UPDATE_STATUS_UPDATED_NEED_REBOOT:
case UPDATE_STATUS_DOWNLOADING: case UPDATE_STATUS_DOWNLOADING:
case UPDATE_STATUS_FINALIZING:
case UPDATE_STATUS_VERIFYING:
DCHECK(!HasCriticalUpdate()); DCHECK(!HasCriticalUpdate());
// Noncritical update, just exit screen as if there is no update. // Noncritical update, just exit screen as if there is no update.
// no break // no break
......
...@@ -36,7 +36,10 @@ class UpdateScreen: public DefaultViewScreen<chromeos::UpdateView>, ...@@ -36,7 +36,10 @@ class UpdateScreen: public DefaultViewScreen<chromeos::UpdateView>,
virtual void CancelUpdate(); virtual void CancelUpdate();
// Reports update results to the ScreenObserver. // Reports update results to the ScreenObserver.
virtual void ExitUpdate(); // |forced| should be set to true when calling this method and update status
// is not one of UPDATE_STATUS_IDLE, UPDATE_STATUS_ERROR,
// UPDATE_STATUS_REPORTING_ERROR_EVENT.
virtual void ExitUpdate(bool forced);
// Maximal curtain time get/set, in seconds. // Maximal curtain time get/set, in seconds.
int maximal_curtain_time() const { return maximal_curtain_time_; } int maximal_curtain_time() const { return maximal_curtain_time_; }
......
...@@ -842,7 +842,7 @@ void WizardController::MarkDeviceRegistered() { ...@@ -842,7 +842,7 @@ void WizardController::MarkDeviceRegistered() {
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// WizardController, chromeos::ScreenObserver overrides: // WizardController, chromeos::ScreenObserver overrides:
void WizardController::OnExit(ExitCodes exit_code) { void WizardController::OnExit(ExitCodes exit_code) {
VLOG(1) << "Wizard screen exit code: " << exit_code; LOG(INFO) << "Wizard screen exit code: " << exit_code;
switch (exit_code) { switch (exit_code) {
case LOGIN_SIGN_IN_SELECTED: case LOGIN_SIGN_IN_SELECTED:
OnLoginSignInSelected(); OnLoginSignInSelected();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment