| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/update_screen.h" | 5 #include "chrome/browser/chromeos/login/update_screen.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/threading/thread_restrictions.h" | 9 #include "base/threading/thread_restrictions.h" |
| 10 #include "chrome/browser/chromeos/cros/cros_library.h" | 10 #include "chrome/browser/chromeos/cros/cros_library.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 UpdateScreen::UpdateScreen(ScreenObserver* screen_observer, | 70 UpdateScreen::UpdateScreen(ScreenObserver* screen_observer, |
| 71 UpdateScreenActor* actor) | 71 UpdateScreenActor* actor) |
| 72 : WizardScreen(screen_observer), | 72 : WizardScreen(screen_observer), |
| 73 reboot_check_delay_(0), | 73 reboot_check_delay_(0), |
| 74 is_checking_for_update_(true), | 74 is_checking_for_update_(true), |
| 75 is_downloading_update_(false), | 75 is_downloading_update_(false), |
| 76 is_ignore_update_deadlines_(false), | 76 is_ignore_update_deadlines_(false), |
| 77 is_shown_(false), | 77 is_shown_(false), |
| 78 ignore_idle_status_(true), | 78 ignore_idle_status_(true), |
| 79 actor_(actor) { | 79 actor_(actor) { |
| 80 actor_->SetDelegate(this); |
| 80 GetInstanceSet().insert(this); | 81 GetInstanceSet().insert(this); |
| 81 } | 82 } |
| 82 | 83 |
| 83 UpdateScreen::~UpdateScreen() { | 84 UpdateScreen::~UpdateScreen() { |
| 84 CrosLibrary::Get()->GetUpdateLibrary()->RemoveObserver(this); | 85 CrosLibrary::Get()->GetUpdateLibrary()->RemoveObserver(this); |
| 85 GetInstanceSet().erase(this); | 86 GetInstanceSet().erase(this); |
| 86 } | 87 } |
| 87 | 88 |
| 88 void UpdateScreen::UpdateStatusChanged(UpdateLibrary* library) { | 89 void UpdateScreen::UpdateStatusChanged(UpdateLibrary* library) { |
| 89 UpdateStatusOperation status = library->status().status; | 90 UpdateStatusOperation status = library->status().status; |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 ExitUpdate(REASON_UPDATE_INIT_FAILED); | 184 ExitUpdate(REASON_UPDATE_INIT_FAILED); |
| 184 } else { | 185 } else { |
| 185 CrosLibrary::Get()->GetUpdateLibrary()->AddObserver(this); | 186 CrosLibrary::Get()->GetUpdateLibrary()->AddObserver(this); |
| 186 VLOG(1) << "Initiate update check"; | 187 VLOG(1) << "Initiate update check"; |
| 187 CrosLibrary::Get()->GetUpdateLibrary()->RequestUpdateCheck( | 188 CrosLibrary::Get()->GetUpdateLibrary()->RequestUpdateCheck( |
| 188 StartUpdateCallback, this); | 189 StartUpdateCallback, this); |
| 189 } | 190 } |
| 190 } | 191 } |
| 191 | 192 |
| 192 void UpdateScreen::CancelUpdate() { | 193 void UpdateScreen::CancelUpdate() { |
| 194 VLOG(1) << "Forced update cancel"; |
| 193 ExitUpdate(REASON_UPDATE_CANCELED); | 195 ExitUpdate(REASON_UPDATE_CANCELED); |
| 194 } | 196 } |
| 195 | 197 |
| 196 void UpdateScreen::Show() { | 198 void UpdateScreen::Show() { |
| 197 is_shown_ = true; | 199 is_shown_ = true; |
| 198 actor_->Show(); | 200 actor_->Show(); |
| 199 actor_->SetProgress(kBeforeUpdateCheckProgress); | 201 actor_->SetProgress(kBeforeUpdateCheckProgress); |
| 200 } | 202 } |
| 201 | 203 |
| 202 void UpdateScreen::Hide() { | 204 void UpdateScreen::Hide() { |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 deadline.empty()) { | 289 deadline.empty()) { |
| 288 return false; | 290 return false; |
| 289 } | 291 } |
| 290 | 292 |
| 291 // TODO(dpolukhin): Analyze file content. Now we can just assume that | 293 // TODO(dpolukhin): Analyze file content. Now we can just assume that |
| 292 // if the file exists and not empty, there is critical update. | 294 // if the file exists and not empty, there is critical update. |
| 293 return true; | 295 return true; |
| 294 } | 296 } |
| 295 | 297 |
| 296 } // namespace chromeos | 298 } // namespace chromeos |
| OLD | NEW |