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

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

Issue 2933923002: Remove update icon after user confirms download (Closed)
Patch Set: Apply fix to patch set 2 Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/system/update/tray_update.h ('k') | ash/system/update/update_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/update/tray_update.cc
diff --git a/ash/system/update/tray_update.cc b/ash/system/update/tray_update.cc
index 5a1058a9ee7617fd3a4d6aa4662857ec551a43be..1f2ca3d3d3d50f9cb18736820dae858197b30d5e 100644
--- a/ash/system/update/tray_update.cc
+++ b/ash/system/update/tray_update.cc
@@ -14,6 +14,7 @@
#include "ash/system/tray/system_tray.h"
#include "ash/system/tray/system_tray_controller.h"
#include "ash/system/tray/system_tray_delegate.h"
+#include "ash/system/tray/system_tray_notifier.h"
#include "ash/system/tray/tray_constants.h"
#include "ash/system/tray/tray_popup_item_style.h"
#include "ash/system/tray/tray_popup_utils.h"
@@ -24,6 +25,7 @@
#include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h"
#include "ui/views/layout/fill_layout.h"
+#include "ui/views/widget/widget.h"
namespace ash {
namespace {
@@ -137,9 +139,13 @@ class TrayUpdate::UpdateView : public ActionableView {
};
TrayUpdate::TrayUpdate(SystemTray* system_tray)
- : TrayImageItem(system_tray, kSystemTrayUpdateIcon, UMA_UPDATE) {}
+ : TrayImageItem(system_tray, kSystemTrayUpdateIcon, UMA_UPDATE) {
+ Shell::Get()->system_tray_notifier()->AddUpdateObserver(this);
+}
-TrayUpdate::~TrayUpdate() {}
+TrayUpdate::~TrayUpdate() {
+ Shell::Get()->system_tray_notifier()->RemoveUpdateObserver(this);
+}
bool TrayUpdate::GetInitialVisibility() {
// If chrome tells ash there is an update available before this item's system
@@ -159,6 +165,16 @@ void TrayUpdate::OnDefaultViewDestroyed() {
update_view_ = nullptr;
}
+void TrayUpdate::OnUpdateOverCellularTargetSet(bool success) {
+ if (!success)
+ return;
+
+ tray_view()->SetVisible(false);
+ update_over_cellular_available_ = false;
+ if (update_view_)
+ update_view_->GetWidget()->Close();
+}
+
void TrayUpdate::ShowUpdateIcon(mojom::UpdateSeverity severity,
bool factory_reset_required,
mojom::UpdateType update_type) {
« no previous file with comments | « ash/system/update/tray_update.h ('k') | ash/system/update/update_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698