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

Unified Diff: ash/system/update/tray_update.cc

Issue 2816253002: Display "Restart to update Adobe Flash Player" for Flash updates. (Closed)
Patch Set: Fix broken test Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: ash/system/update/tray_update.cc
diff --git a/ash/system/update/tray_update.cc b/ash/system/update/tray_update.cc
index 55a82c5649a29a7510b5637802f1ce406392c228..7b7ea192777d072ec63d5d6471772da419689d7d 100644
--- a/ash/system/update/tray_update.cc
+++ b/ash/system/update/tray_update.cc
@@ -60,6 +60,7 @@ bool TrayUpdate::update_required_ = false;
mojom::UpdateSeverity TrayUpdate::severity_ = mojom::UpdateSeverity::NONE;
// static
bool TrayUpdate::factory_reset_required_ = false;
+mojom::UpdateType TrayUpdate::update_type_ = mojom::UpdateType::NONE;
// The "restart to update" item in the system tray menu.
class TrayUpdate::UpdateView : public ActionableView {
@@ -77,11 +78,16 @@ class TrayUpdate::UpdateView : public ActionableView {
IconColorForUpdateSeverity(owner->severity_, true)));
tri_view->AddView(TriView::Container::START, image);
- base::string16 label_text =
- owner->factory_reset_required_
- ? bundle.GetLocalizedString(
- IDS_ASH_STATUS_TRAY_RESTART_AND_POWERWASH_TO_UPDATE)
- : bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_UPDATE);
+ base::string16 label_text;
+ if (owner->factory_reset_required_) {
+ label_text = bundle.GetLocalizedString(
+ IDS_ASH_STATUS_TRAY_RESTART_AND_POWERWASH_TO_UPDATE);
+ } else if (owner->update_type_ == mojom::UpdateType::FLASH) {
+ label_text = bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_UPDATE_FLASH);
+ } else {
+ label_text = bundle.GetLocalizedString(IDS_ASH_STATUS_TRAY_UPDATE);
+ }
+
SetAccessibleName(label_text);
auto* label = TrayPopupUtils::CreateDefaultLabel();
label->SetText(label_text);
@@ -123,11 +129,13 @@ views::View* TrayUpdate::CreateDefaultView(LoginStatus status) {
}
void TrayUpdate::ShowUpdateIcon(mojom::UpdateSeverity severity,
- bool factory_reset_required) {
+ bool factory_reset_required,
+ mojom::UpdateType update_type) {
// Cache update info so we can create the default view when the menu opens.
update_required_ = true;
severity_ = severity;
factory_reset_required_ = factory_reset_required;
+ update_type_ = update_type;
// Show the icon in the tray.
SetIconColor(IconColorForUpdateSeverity(severity_, false));

Powered by Google App Engine
This is Rietveld 408576698