OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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 |
| 5 #include "chrome/browser/ui/ash/system_tray_delegate_utils.h" |
| 6 |
| 7 #include "ash/system/tray/system_tray_delegate.h" |
| 8 #include "base/logging.h" |
| 9 #include "chrome/browser/upgrade_detector.h" |
| 10 |
| 11 namespace system_tray_delegate_utils { |
| 12 |
| 13 void GetUpdateInfo(const UpgradeDetector* detector, ash::UpdateInfo* info) { |
| 14 DCHECK(detector); |
| 15 DCHECK(info); |
| 16 switch (detector->upgrade_notification_stage()) { |
| 17 case UpgradeDetector::UPGRADE_ANNOYANCE_CRITICAL: |
| 18 case UpgradeDetector::UPGRADE_ANNOYANCE_SEVERE: |
| 19 info->severity = ash::UpdateInfo::UPDATE_SEVERE_RED; |
| 20 break; |
| 21 case UpgradeDetector::UPGRADE_ANNOYANCE_HIGH: |
| 22 info->severity = ash::UpdateInfo::UPDATE_HIGH_ORANGE; |
| 23 break; |
| 24 case UpgradeDetector::UPGRADE_ANNOYANCE_ELEVATED: |
| 25 info->severity = ash::UpdateInfo::UPDATE_LOW_GREEN; |
| 26 break; |
| 27 case UpgradeDetector::UPGRADE_ANNOYANCE_LOW: |
| 28 case UpgradeDetector::UPGRADE_ANNOYANCE_NONE: |
| 29 info->severity = ash::UpdateInfo::UPDATE_NORMAL; |
| 30 break; |
| 31 } |
| 32 info->update_required = detector->notify_upgrade(); |
| 33 info->factory_reset_required = detector->is_factory_reset_required(); |
| 34 } |
| 35 |
| 36 } // namespace system_tray_delegate_utils |
OLD | NEW |