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

Side by Side Diff: chrome/browser/chromeos/update_observer.cc

Issue 3053010: Show an error update engine status for all unknown states. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/update_observer.h" 5 #include "chrome/browser/chromeos/update_observer.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/common/time_format.h" 10 #include "chrome/common/time_format.h"
11 #include "grit/generated_resources.h" 11 #include "grit/generated_resources.h"
12 #include "grit/theme_resources.h" 12 #include "grit/theme_resources.h"
13 13
14 namespace chromeos { 14 namespace chromeos {
15 15
16 UpdateObserver::UpdateObserver(Profile* profile) 16 UpdateObserver::UpdateObserver(Profile* profile)
17 : notification_(profile, "update.chromeos", IDR_NOTIFICATION_UPDATE, 17 : notification_(profile, "update.chromeos", IDR_NOTIFICATION_UPDATE,
18 l10n_util::GetStringUTF16(IDS_UPDATE_TITLE)), 18 l10n_util::GetStringUTF16(IDS_UPDATE_TITLE)),
19 progress_(-1) {} 19 progress_(-1) {}
20 20
21 UpdateObserver::~UpdateObserver() { 21 UpdateObserver::~UpdateObserver() {
22 notification_.Hide(); 22 notification_.Hide();
23 } 23 }
24 24
25 void UpdateObserver::Changed(UpdateLibrary* object) { 25 void UpdateObserver::Changed(UpdateLibrary* object) {
26 switch (object->status().status) { 26 switch (object->status().status) {
27 case UPDATE_STATUS_ERROR:
28 notification_.Show(l10n_util::GetStringUTF16(IDS_UPDATE_ERROR), true);
29 break;
30 case UPDATE_STATUS_IDLE: 27 case UPDATE_STATUS_IDLE:
31 case UPDATE_STATUS_CHECKING_FOR_UPDATE: 28 case UPDATE_STATUS_CHECKING_FOR_UPDATE:
32 // Do nothing in these cases, we don't want to notify the user of the 29 // Do nothing in these cases, we don't want to notify the user of the
33 // check unless there is an update. We don't hide here because 30 // check unless there is an update. We don't hide here because
34 // we want the final state to be sticky. 31 // we want the final state to be sticky.
35 break; 32 break;
36 case UPDATE_STATUS_UPDATE_AVAILABLE: 33 case UPDATE_STATUS_UPDATE_AVAILABLE:
37 notification_.Show(l10n_util::GetStringUTF16(IDS_UPDATE_AVAILABLE), 34 notification_.Show(l10n_util::GetStringUTF16(IDS_UPDATE_AVAILABLE),
38 false); 35 false);
39 break; 36 break;
(...skipping 12 matching lines...) Expand all
52 notification_.Show(l10n_util::GetStringUTF16(IDS_UPDATE_VERIFYING), 49 notification_.Show(l10n_util::GetStringUTF16(IDS_UPDATE_VERIFYING),
53 false); 50 false);
54 break; 51 break;
55 case UPDATE_STATUS_FINALIZING: 52 case UPDATE_STATUS_FINALIZING:
56 notification_.Show(l10n_util::GetStringUTF16(IDS_UPDATE_FINALIZING), 53 notification_.Show(l10n_util::GetStringUTF16(IDS_UPDATE_FINALIZING),
57 false); 54 false);
58 break; 55 break;
59 case UPDATE_STATUS_UPDATED_NEED_REBOOT: 56 case UPDATE_STATUS_UPDATED_NEED_REBOOT:
60 notification_.Show(l10n_util::GetStringUTF16(IDS_UPDATE_COMPLETED), true); 57 notification_.Show(l10n_util::GetStringUTF16(IDS_UPDATE_COMPLETED), true);
61 break; 58 break;
59 default:
60 notification_.Show(l10n_util::GetStringUTF16(IDS_UPDATE_ERROR), true);
61 break;
62 } 62 }
63 } 63 }
64 64
65 } // namespace chromeos 65 } // namespace chromeos
66
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698