update_types.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // Copyright 2019 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef ASH_PUBLIC_CPP_UPDATE_TYPES_H_
  5. #define ASH_PUBLIC_CPP_UPDATE_TYPES_H_
  6. #include "base/time/time.h"
  7. namespace ash {
  8. // Urgency of a pending software update. Sets the system tray update icon color.
  9. // These correspond to values in UpgradeDetector's
  10. // `UpgradeNotificationAnnoyanceLevel` enum. Their use is platform-specific.
  11. // Please refer to `UpgradeDetectorChromeos` for details.
  12. // TODO(jamescook): `UpgradeDetector::UpgradeNotificationAnnoyanceLevel` could
  13. // be replaced with this if this moves into a component shared with non-ash
  14. // chrome.
  15. enum class UpdateSeverity {
  16. kNone,
  17. kVeryLow,
  18. kLow,
  19. kElevated,
  20. kGrace,
  21. kHigh,
  22. kCritical,
  23. };
  24. // The type of update being applied. Sets the string in the system tray.
  25. enum class UpdateType {
  26. kLacros, // Lacros browser, see //docs/lacros.md
  27. kSystem,
  28. };
  29. // State for deferred system updates.
  30. enum class DeferredUpdateState {
  31. // No deferred update available.
  32. kNone,
  33. // Show deferred update available dialog.
  34. kShowDialog,
  35. // Show deferred update available notification.
  36. kShowNotification
  37. };
  38. // Notification state for system updates, set by policies.
  39. struct RelaunchNotificationState {
  40. enum {
  41. kNone, // Relaunch is not required.
  42. kRecommendedNotOverdue, // Relaunch is recommended but not overdue.
  43. kRecommendedAndOverdue, // Relaunch is recommended and overdue.
  44. kRequired, // Relaunch is required until
  45. // `rounded_time_until_reboot_required`.
  46. } requirement_type = kNone;
  47. enum PolicySource {
  48. kUser, // Relaunch notifications are triggered by a user policy.
  49. kDevice, // Relaunch notifications are triggered by a device policy..
  50. } policy_source = kUser;
  51. // The remaining time until the device will restart itself, rounded to the
  52. // nearest day, hour, minute, or second; depending on how far into the future
  53. // it is.
  54. base::TimeDelta rounded_time_until_reboot_required = base::TimeDelta();
  55. };
  56. } // namespace ash
  57. #endif // ASH_PUBLIC_CPP_UPDATE_TYPES_H_