| 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/chromeos/login/screens/update_screen.h" | 5 #include "chrome/browser/chromeos/login/screens/update_screen.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 ignore_idle_status_ = ignore_idle_status; | 168 ignore_idle_status_ = ignore_idle_status; |
| 169 } | 169 } |
| 170 | 170 |
| 171 void UpdateScreen::ExitUpdate(UpdateScreen::ExitReason reason) { | 171 void UpdateScreen::ExitUpdate(UpdateScreen::ExitReason reason) { |
| 172 DBusThreadManager::Get()->GetUpdateEngineClient()->RemoveObserver(this); | 172 DBusThreadManager::Get()->GetUpdateEngineClient()->RemoveObserver(this); |
| 173 network_portal_detector::GetInstance()->RemoveObserver(this); | 173 network_portal_detector::GetInstance()->RemoveObserver(this); |
| 174 SetHostPairingControllerStatus(HostPairingController::UPDATE_STATUS_UPDATED); | 174 SetHostPairingControllerStatus(HostPairingController::UPDATE_STATUS_UPDATED); |
| 175 | 175 |
| 176 switch (reason) { | 176 switch (reason) { |
| 177 case REASON_UPDATE_CANCELED: | 177 case REASON_UPDATE_CANCELED: |
| 178 Finish(BaseScreenDelegate::UPDATE_NOUPDATE); | 178 Finish(ScreenExitCode::UPDATE_NOUPDATE); |
| 179 break; | 179 break; |
| 180 case REASON_UPDATE_INIT_FAILED: | 180 case REASON_UPDATE_INIT_FAILED: |
| 181 Finish(BaseScreenDelegate::UPDATE_ERROR_CHECKING_FOR_UPDATE); | 181 Finish(ScreenExitCode::UPDATE_ERROR_CHECKING_FOR_UPDATE); |
| 182 break; | 182 break; |
| 183 case REASON_UPDATE_NON_CRITICAL: | 183 case REASON_UPDATE_NON_CRITICAL: |
| 184 case REASON_UPDATE_ENDED: { | 184 case REASON_UPDATE_ENDED: { |
| 185 UpdateEngineClient* update_engine_client = | 185 UpdateEngineClient* update_engine_client = |
| 186 DBusThreadManager::Get()->GetUpdateEngineClient(); | 186 DBusThreadManager::Get()->GetUpdateEngineClient(); |
| 187 switch (update_engine_client->GetLastStatus().status) { | 187 switch (update_engine_client->GetLastStatus().status) { |
| 188 case UpdateEngineClient::UPDATE_STATUS_ATTEMPTING_ROLLBACK: | 188 case UpdateEngineClient::UPDATE_STATUS_ATTEMPTING_ROLLBACK: |
| 189 break; | 189 break; |
| 190 case UpdateEngineClient::UPDATE_STATUS_UPDATE_AVAILABLE: | 190 case UpdateEngineClient::UPDATE_STATUS_UPDATE_AVAILABLE: |
| 191 case UpdateEngineClient::UPDATE_STATUS_UPDATED_NEED_REBOOT: | 191 case UpdateEngineClient::UPDATE_STATUS_UPDATED_NEED_REBOOT: |
| 192 case UpdateEngineClient::UPDATE_STATUS_DOWNLOADING: | 192 case UpdateEngineClient::UPDATE_STATUS_DOWNLOADING: |
| 193 case UpdateEngineClient::UPDATE_STATUS_FINALIZING: | 193 case UpdateEngineClient::UPDATE_STATUS_FINALIZING: |
| 194 case UpdateEngineClient::UPDATE_STATUS_VERIFYING: | 194 case UpdateEngineClient::UPDATE_STATUS_VERIFYING: |
| 195 DCHECK(!HasCriticalUpdate()); | 195 DCHECK(!HasCriticalUpdate()); |
| 196 // Noncritical update, just exit screen as if there is no update. | 196 // Noncritical update, just exit screen as if there is no update. |
| 197 // no break | 197 // no break |
| 198 case UpdateEngineClient::UPDATE_STATUS_IDLE: | 198 case UpdateEngineClient::UPDATE_STATUS_IDLE: |
| 199 Finish(BaseScreenDelegate::UPDATE_NOUPDATE); | 199 Finish(ScreenExitCode::UPDATE_NOUPDATE); |
| 200 break; | 200 break; |
| 201 case UpdateEngineClient::UPDATE_STATUS_ERROR: | 201 case UpdateEngineClient::UPDATE_STATUS_ERROR: |
| 202 case UpdateEngineClient::UPDATE_STATUS_REPORTING_ERROR_EVENT: | 202 case UpdateEngineClient::UPDATE_STATUS_REPORTING_ERROR_EVENT: |
| 203 if (is_checking_for_update_) { | 203 if (is_checking_for_update_) { |
| 204 Finish(BaseScreenDelegate::UPDATE_ERROR_CHECKING_FOR_UPDATE); | 204 Finish(ScreenExitCode::UPDATE_ERROR_CHECKING_FOR_UPDATE); |
| 205 } else if (HasCriticalUpdate()) { | 205 } else if (HasCriticalUpdate()) { |
| 206 Finish(BaseScreenDelegate::UPDATE_ERROR_UPDATING_CRITICAL_UPDATE); | 206 Finish(ScreenExitCode::UPDATE_ERROR_UPDATING_CRITICAL_UPDATE); |
| 207 } else { | 207 } else { |
| 208 Finish(BaseScreenDelegate::UPDATE_ERROR_UPDATING); | 208 Finish(ScreenExitCode::UPDATE_ERROR_UPDATING); |
| 209 } | 209 } |
| 210 break; | 210 break; |
| 211 default: | 211 default: |
| 212 NOTREACHED(); | 212 NOTREACHED(); |
| 213 } | 213 } |
| 214 } break; | 214 } break; |
| 215 default: | 215 default: |
| 216 NOTREACHED(); | 216 NOTREACHED(); |
| 217 } | 217 } |
| 218 } | 218 } |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 } | 594 } |
| 595 | 595 |
| 596 void UpdateScreen::OnConnectRequested() { | 596 void UpdateScreen::OnConnectRequested() { |
| 597 if (state_ == State::STATE_ERROR) { | 597 if (state_ == State::STATE_ERROR) { |
| 598 LOG(WARNING) << "Hiding error message since AP was reselected"; | 598 LOG(WARNING) << "Hiding error message since AP was reselected"; |
| 599 StartUpdateCheck(); | 599 StartUpdateCheck(); |
| 600 } | 600 } |
| 601 } | 601 } |
| 602 | 602 |
| 603 } // namespace chromeos | 603 } // namespace chromeos |
| OLD | NEW |