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

Side by Side Diff: chrome/browser/ui/webui/help/version_updater_chromeos.cc

Issue 309533006: Added processing for a lost status to UpdateEngineClient. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Switch fixed. Created 6 years, 6 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/ui/webui/help/version_updater_chromeos.h" 5 #include "chrome/browser/ui/webui/help/version_updater_chromeos.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 UpdateEngineClient::UpdateStatusOperation operation_to_show = status.status; 168 UpdateEngineClient::UpdateStatusOperation operation_to_show = status.status;
169 if (status.status == UpdateEngineClient::UPDATE_STATUS_IDLE && 169 if (status.status == UpdateEngineClient::UPDATE_STATUS_IDLE &&
170 last_operation_ != 170 last_operation_ !=
171 UpdateEngineClient::UPDATE_STATUS_CHECKING_FOR_UPDATE) { 171 UpdateEngineClient::UPDATE_STATUS_CHECKING_FOR_UPDATE) {
172 operation_to_show = last_operation_; 172 operation_to_show = last_operation_;
173 } 173 }
174 174
175 switch (operation_to_show) { 175 switch (operation_to_show) {
176 case UpdateEngineClient::UPDATE_STATUS_ERROR: 176 case UpdateEngineClient::UPDATE_STATUS_ERROR:
177 case UpdateEngineClient::UPDATE_STATUS_REPORTING_ERROR_EVENT: 177 case UpdateEngineClient::UPDATE_STATUS_REPORTING_ERROR_EVENT:
178 case UpdateEngineClient::UPDATE_STATUS_ATTEMPTING_ROLLBACK:
178 // This path previously used the FAILED status and IDS_UPGRADE_ERROR, but 179 // This path previously used the FAILED status and IDS_UPGRADE_ERROR, but
179 // the update engine reports errors for some conditions that shouldn't 180 // the update engine reports errors for some conditions that shouldn't
180 // actually be displayed as errors to users: http://crbug.com/146919. 181 // actually be displayed as errors to users: http://crbug.com/146919.
181 // Just use the UPDATED status instead. 182 // Just use the UPDATED status instead.
182 break; 183 break;
183 case UpdateEngineClient::UPDATE_STATUS_CHECKING_FOR_UPDATE: 184 case UpdateEngineClient::UPDATE_STATUS_CHECKING_FOR_UPDATE:
184 my_status = CHECKING; 185 my_status = CHECKING;
185 break; 186 break;
186 case UpdateEngineClient::UPDATE_STATUS_DOWNLOADING: 187 case UpdateEngineClient::UPDATE_STATUS_DOWNLOADING:
187 progress = static_cast<int>(round(status.download_progress * 100)); 188 progress = static_cast<int>(round(status.download_progress * 100));
(...skipping 19 matching lines...) Expand all
207 last_operation_ = status.status; 208 last_operation_ = status.status;
208 } 209 }
209 210
210 void VersionUpdaterCros::OnUpdateCheck( 211 void VersionUpdaterCros::OnUpdateCheck(
211 UpdateEngineClient::UpdateCheckResult result) { 212 UpdateEngineClient::UpdateCheckResult result) {
212 // If version updating is not implemented, this binary is the most up-to-date 213 // If version updating is not implemented, this binary is the most up-to-date
213 // possible with respect to automatic updating. 214 // possible with respect to automatic updating.
214 if (result == UpdateEngineClient::UPDATE_RESULT_NOTIMPLEMENTED) 215 if (result == UpdateEngineClient::UPDATE_RESULT_NOTIMPLEMENTED)
215 callback_.Run(UPDATED, 0, base::string16()); 216 callback_.Run(UPDATED, 0, base::string16());
216 } 217 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/system_private/system_private_api.cc ('k') | chromeos/dbus/update_engine_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698