| 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 #ifndef ASH_COMMON_SYSTEM_UPDATE_TRAY_UPDATE_H_ | 5 #ifndef ASH_COMMON_SYSTEM_UPDATE_TRAY_UPDATE_H_ |
| 6 #define ASH_COMMON_SYSTEM_UPDATE_TRAY_UPDATE_H_ | 6 #define ASH_COMMON_SYSTEM_UPDATE_TRAY_UPDATE_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/common/system/tray/tray_image_item.h" | 9 #include "ash/common/system/tray/tray_image_item.h" |
| 10 #include "ash/common/system/update/update_observer.h" | 10 #include "ash/common/system/update/update_observer.h" |
| 11 #include "ash/public/interfaces/update.mojom.h" |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 | 13 |
| 13 namespace views { | 14 namespace views { |
| 14 class View; | 15 class View; |
| 15 } | 16 } |
| 16 | 17 |
| 17 namespace ash { | 18 namespace ash { |
| 18 | 19 |
| 19 // The system update tray item. Exported for test. | 20 // The system update tray item. The tray icon stays visible once an update |
| 21 // notification is received. The icon only disappears after a reboot to apply |
| 22 // the update. Exported for test. |
| 20 class ASH_EXPORT TrayUpdate : public TrayImageItem, public UpdateObserver { | 23 class ASH_EXPORT TrayUpdate : public TrayImageItem, public UpdateObserver { |
| 21 public: | 24 public: |
| 22 explicit TrayUpdate(SystemTray* system_tray); | 25 explicit TrayUpdate(SystemTray* system_tray); |
| 23 ~TrayUpdate() override; | 26 ~TrayUpdate() override; |
| 24 | 27 |
| 25 private: | 28 private: |
| 29 class UpdateView; |
| 30 |
| 26 // Overridden from TrayImageItem. | 31 // Overridden from TrayImageItem. |
| 27 bool GetInitialVisibility() override; | 32 bool GetInitialVisibility() override; |
| 28 views::View* CreateDefaultView(LoginStatus status) override; | 33 views::View* CreateDefaultView(LoginStatus status) override; |
| 29 | 34 |
| 30 // Overridden from UpdateObserver. | 35 // Overridden from UpdateObserver. |
| 31 void OnUpdateRecommended(const UpdateInfo& info) override; | 36 void ShowUpdateIcon(mojom::UpdateSeverity severity, |
| 37 bool factory_reset_required) override; |
| 38 |
| 39 bool update_required_ = false; |
| 40 mojom::UpdateSeverity severity_ = mojom::UpdateSeverity::NONE; |
| 41 bool factory_reset_required_ = false; |
| 32 | 42 |
| 33 DISALLOW_COPY_AND_ASSIGN(TrayUpdate); | 43 DISALLOW_COPY_AND_ASSIGN(TrayUpdate); |
| 34 }; | 44 }; |
| 35 | 45 |
| 36 } // namespace ash | 46 } // namespace ash |
| 37 | 47 |
| 38 #endif // ASH_COMMON_SYSTEM_UPDATE_TRAY_UPDATE_H_ | 48 #endif // ASH_COMMON_SYSTEM_UPDATE_TRAY_UPDATE_H_ |
| OLD | NEW |