Chromium Code Reviews| 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_SYSTEM_UPDATE_TRAY_UPDATE_H_ | 5 #ifndef ASH_SYSTEM_UPDATE_TRAY_UPDATE_H_ |
| 6 #define ASH_SYSTEM_UPDATE_TRAY_UPDATE_H_ | 6 #define ASH_SYSTEM_UPDATE_TRAY_UPDATE_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/system/tray/tray_image_item.h" | 9 #include "ash/system/tray/tray_image_item.h" |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 31 explicit TrayUpdate(SystemTray* system_tray); | 31 explicit TrayUpdate(SystemTray* system_tray); |
| 32 ~TrayUpdate() override; | 32 ~TrayUpdate() override; |
| 33 | 33 |
| 34 // Shows an icon in the system tray indicating that a software update is | 34 // Shows an icon in the system tray indicating that a software update is |
| 35 // available. Once shown the icon persists until reboot. |severity| and | 35 // available. Once shown the icon persists until reboot. |severity| and |
| 36 // |factory_reset_required| are used to set the icon, color, and tooltip. | 36 // |factory_reset_required| are used to set the icon, color, and tooltip. |
| 37 void ShowUpdateIcon(mojom::UpdateSeverity severity, | 37 void ShowUpdateIcon(mojom::UpdateSeverity severity, |
| 38 bool factory_reset_required, | 38 bool factory_reset_required, |
| 39 mojom::UpdateType update_type); | 39 mojom::UpdateType update_type); |
| 40 | 40 |
| 41 // Shows an icon in the system tray indicating that a software update is | |
| 42 // available but user's agreement is required as current connection is | |
| 43 // cellular. Once shown the icon persists until reboot. | |
| 44 void ShowUpdateOverCellularAvailableIcon(); | |
| 45 | |
| 41 private: | 46 private: |
| 42 FRIEND_TEST_ALL_PREFIXES(TrayUpdateTest, VisibilityAfterUpdate); | 47 FRIEND_TEST_ALL_PREFIXES(TrayUpdateTest, VisibilityAfterUpdate); |
| 43 FRIEND_TEST_ALL_PREFIXES(TrayUpdateTest, VisibilityAfterFlashUpdate); | 48 FRIEND_TEST_ALL_PREFIXES(TrayUpdateTest, VisibilityAfterFlashUpdate); |
| 44 | 49 |
| 45 class UpdateView; | 50 class UpdateView; |
| 46 | 51 |
| 47 // Overridden from TrayImageItem. | 52 // Overridden from TrayImageItem. |
| 48 bool GetInitialVisibility() override; | 53 bool GetInitialVisibility() override; |
| 49 views::View* CreateDefaultView(LoginStatus status) override; | 54 views::View* CreateDefaultView(LoginStatus status) override; |
| 50 void DestroyDefaultView() override; | 55 void DestroyDefaultView() override; |
| 51 | 56 |
| 52 // Expose label information for testing. | 57 // Expose label information for testing. |
| 53 views::Label* GetLabelForTesting(); | 58 views::Label* GetLabelForTesting(); |
| 54 UpdateView* update_view_; | 59 UpdateView* update_view_; |
| 55 | 60 |
| 56 // If an external monitor is connected then the system tray may be created | 61 // If an external monitor is connected then the system tray may be created |
| 57 // after the update data is sent from chrome, so share the update info between | 62 // after the update data is sent from chrome, so share the update info between |
| 58 // all instances. | 63 // all instances. |
| 59 static bool update_required_; | 64 static bool upgrade_required_; |
|
weidongg
2017/05/15 04:54:13
I refactored here to distinguish 'update' with 'up
| |
| 60 static mojom::UpdateSeverity severity_; | 65 static mojom::UpdateSeverity severity_; |
| 61 static bool factory_reset_required_; | 66 static bool factory_reset_required_; |
| 62 static mojom::UpdateType update_type_; | 67 static mojom::UpdateType update_type_; |
| 68 static bool update_over_cellular_available_; | |
| 63 | 69 |
| 64 DISALLOW_COPY_AND_ASSIGN(TrayUpdate); | 70 DISALLOW_COPY_AND_ASSIGN(TrayUpdate); |
| 65 }; | 71 }; |
| 66 | 72 |
| 67 } // namespace ash | 73 } // namespace ash |
| 68 | 74 |
| 69 #endif // ASH_SYSTEM_UPDATE_TRAY_UPDATE_H_ | 75 #endif // ASH_SYSTEM_UPDATE_TRAY_UPDATE_H_ |
| OLD | NEW |