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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 UpdateEngineClient* update_engine_client = | 190 UpdateEngineClient* update_engine_client = |
191 DBusThreadManager::Get()->GetUpdateEngineClient(); | 191 DBusThreadManager::Get()->GetUpdateEngineClient(); |
192 switch (update_engine_client->GetLastStatus().status) { | 192 switch (update_engine_client->GetLastStatus().status) { |
193 case UpdateEngineClient::UPDATE_STATUS_ATTEMPTING_ROLLBACK: | 193 case UpdateEngineClient::UPDATE_STATUS_ATTEMPTING_ROLLBACK: |
194 break; | 194 break; |
195 case UpdateEngineClient::UPDATE_STATUS_UPDATE_AVAILABLE: | 195 case UpdateEngineClient::UPDATE_STATUS_UPDATE_AVAILABLE: |
196 case UpdateEngineClient::UPDATE_STATUS_UPDATED_NEED_REBOOT: | 196 case UpdateEngineClient::UPDATE_STATUS_UPDATED_NEED_REBOOT: |
197 case UpdateEngineClient::UPDATE_STATUS_DOWNLOADING: | 197 case UpdateEngineClient::UPDATE_STATUS_DOWNLOADING: |
198 case UpdateEngineClient::UPDATE_STATUS_FINALIZING: | 198 case UpdateEngineClient::UPDATE_STATUS_FINALIZING: |
199 case UpdateEngineClient::UPDATE_STATUS_VERIFYING: | 199 case UpdateEngineClient::UPDATE_STATUS_VERIFYING: |
| 200 case UpdateEngineClient::UPDATE_STATUS_NEED_PERMISSION_TO_UPDATE: |
200 DCHECK(!HasCriticalUpdate()); | 201 DCHECK(!HasCriticalUpdate()); |
201 // Noncritical update, just exit screen as if there is no update. | 202 // Noncritical update, just exit screen as if there is no update. |
202 // no break | 203 // no break |
203 case UpdateEngineClient::UPDATE_STATUS_IDLE: | 204 case UpdateEngineClient::UPDATE_STATUS_IDLE: |
204 Finish(ScreenExitCode::UPDATE_NOUPDATE); | 205 Finish(ScreenExitCode::UPDATE_NOUPDATE); |
205 break; | 206 break; |
206 case UpdateEngineClient::UPDATE_STATUS_ERROR: | 207 case UpdateEngineClient::UPDATE_STATUS_ERROR: |
207 case UpdateEngineClient::UPDATE_STATUS_REPORTING_ERROR_EVENT: | 208 case UpdateEngineClient::UPDATE_STATUS_REPORTING_ERROR_EVENT: |
208 if (is_checking_for_update_) { | 209 if (is_checking_for_update_) { |
209 Finish(ScreenExitCode::UPDATE_ERROR_CHECKING_FOR_UPDATE); | 210 Finish(ScreenExitCode::UPDATE_ERROR_CHECKING_FOR_UPDATE); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 VLOG(1) << "Attempting rollback"; | 324 VLOG(1) << "Attempting rollback"; |
324 break; | 325 break; |
325 case UpdateEngineClient::UPDATE_STATUS_IDLE: | 326 case UpdateEngineClient::UPDATE_STATUS_IDLE: |
326 if (ignore_idle_status_) { | 327 if (ignore_idle_status_) { |
327 // It is first IDLE status that is sent before we initiated the check. | 328 // It is first IDLE status that is sent before we initiated the check. |
328 break; | 329 break; |
329 } | 330 } |
330 // else no break | 331 // else no break |
331 case UpdateEngineClient::UPDATE_STATUS_ERROR: | 332 case UpdateEngineClient::UPDATE_STATUS_ERROR: |
332 case UpdateEngineClient::UPDATE_STATUS_REPORTING_ERROR_EVENT: | 333 case UpdateEngineClient::UPDATE_STATUS_REPORTING_ERROR_EVENT: |
| 334 case UpdateEngineClient::UPDATE_STATUS_NEED_PERMISSION_TO_UPDATE: |
333 ExitUpdate(REASON_UPDATE_ENDED); | 335 ExitUpdate(REASON_UPDATE_ENDED); |
334 break; | 336 break; |
335 default: | 337 default: |
336 NOTREACHED(); | 338 NOTREACHED(); |
337 break; | 339 break; |
338 } | 340 } |
339 } | 341 } |
340 | 342 |
341 void UpdateScreen::OnPortalDetectionCompleted( | 343 void UpdateScreen::OnPortalDetectionCompleted( |
342 const NetworkState* network, | 344 const NetworkState* network, |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 } | 623 } |
622 | 624 |
623 void UpdateScreen::OnConnectRequested() { | 625 void UpdateScreen::OnConnectRequested() { |
624 if (state_ == State::STATE_ERROR) { | 626 if (state_ == State::STATE_ERROR) { |
625 LOG(WARNING) << "Hiding error message since AP was reselected"; | 627 LOG(WARNING) << "Hiding error message since AP was reselected"; |
626 StartUpdateCheck(); | 628 StartUpdateCheck(); |
627 } | 629 } |
628 } | 630 } |
629 | 631 |
630 } // namespace chromeos | 632 } // namespace chromeos |
OLD | NEW |