Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / ui / ash / system_tray_delegate_utils.cc
blob2404b5207e72171f72a844ad273d1282cb4ade7d
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.
5 #include "chrome/browser/ui/ash/system_tray_delegate_utils.h"
7 #include "ash/system/tray/system_tray_delegate.h"
8 #include "base/logging.h"
9 #include "chrome/browser/upgrade_detector.h"
11 void GetUpdateInfo(const UpgradeDetector* detector, ash::UpdateInfo* info) {
12 DCHECK(detector);
13 DCHECK(info);
14 switch (detector->upgrade_notification_stage()) {
15 case UpgradeDetector::UPGRADE_ANNOYANCE_CRITICAL:
16 case UpgradeDetector::UPGRADE_ANNOYANCE_SEVERE:
17 info->severity = ash::UpdateInfo::UPDATE_SEVERE_RED;
18 break;
19 case UpgradeDetector::UPGRADE_ANNOYANCE_HIGH:
20 info->severity = ash::UpdateInfo::UPDATE_HIGH_ORANGE;
21 break;
22 case UpgradeDetector::UPGRADE_ANNOYANCE_ELEVATED:
23 info->severity = ash::UpdateInfo::UPDATE_LOW_GREEN;
24 break;
25 case UpgradeDetector::UPGRADE_ANNOYANCE_LOW:
26 case UpgradeDetector::UPGRADE_ANNOYANCE_NONE:
27 info->severity = ash::UpdateInfo::UPDATE_NORMAL;
28 break;
30 info->update_required = detector->notify_upgrade();
31 info->factory_reset_required = detector->is_factory_reset_required();