| Index: chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
|
| diff --git a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
|
| index 2d5e39f57bd3c8e410f65eadc322c8e86da473f5..fc872cfd84f516ee552cc9ad0a94448e96b779e7 100644
|
| --- a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
|
| +++ b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
|
| @@ -182,6 +182,33 @@ void OnAcceptMultiprofilesIntro(bool no_show_again) {
|
| UserAddingScreen::Get()->Start();
|
| }
|
|
|
| +void GetUpdateInfo(const UpgradeDetector* detector, ash::UpdateInfo* info) {
|
| + if (!detector || !info)
|
| + return;
|
| + ash::UpdateInfo::UpdateSeverity severity =
|
| + ash::UpdateInfo::UPDATE_NORMAL;
|
| + switch (detector->upgrade_notification_stage()) {
|
| + case UpgradeDetector::UPGRADE_ANNOYANCE_SEVERE:
|
| + severity = ash::UpdateInfo::UPDATE_SEVERE_RED;
|
| + break;
|
| +
|
| + case UpgradeDetector::UPGRADE_ANNOYANCE_HIGH:
|
| + severity = ash::UpdateInfo::UPDATE_HIGH_ORANGE;
|
| + break;
|
| +
|
| + case UpgradeDetector::UPGRADE_ANNOYANCE_ELEVATED:
|
| + severity = ash::UpdateInfo::UPDATE_LOW_GREEN;
|
| + break;
|
| +
|
| + case UpgradeDetector::UPGRADE_ANNOYANCE_LOW:
|
| + default:
|
| + severity = ash::UpdateInfo::UPDATE_NORMAL;
|
| + break;
|
| + }
|
| + info->severity = severity;
|
| + info->is_factory_reset_required = detector->is_factory_reset_required();
|
| +}
|
| +
|
| } // namespace
|
|
|
| SystemTrayDelegateChromeOS::SystemTrayDelegateChromeOS()
|
| @@ -406,8 +433,11 @@ bool SystemTrayDelegateChromeOS::IsUserSupervised() const {
|
| return user && user->IsSupervised();
|
| }
|
|
|
| -bool SystemTrayDelegateChromeOS::SystemShouldUpgrade() const {
|
| - return UpgradeDetector::GetInstance()->notify_upgrade();
|
| +bool SystemTrayDelegateChromeOS::SystemShouldUpgrade(
|
| + ash::UpdateInfo* info) const {
|
| + UpgradeDetector* detector = UpgradeDetector::GetInstance();
|
| + GetUpdateInfo(detector, info);
|
| + return detector->notify_upgrade();
|
| }
|
|
|
| base::HourClockType SystemTrayDelegateChromeOS::GetHourClockType() const {
|
| @@ -1087,29 +1117,9 @@ void SystemTrayDelegateChromeOS::Observe(
|
| const content::NotificationDetails& details) {
|
| switch (type) {
|
| case chrome::NOTIFICATION_UPGRADE_RECOMMENDED: {
|
| - UpgradeDetector* detector =
|
| - content::Source<UpgradeDetector>(source).ptr();
|
| - ash::UpdateObserver::UpdateSeverity severity =
|
| - ash::UpdateObserver::UPDATE_NORMAL;
|
| - switch (detector->upgrade_notification_stage()) {
|
| - case UpgradeDetector::UPGRADE_ANNOYANCE_SEVERE:
|
| - severity = ash::UpdateObserver::UPDATE_SEVERE_RED;
|
| - break;
|
| -
|
| - case UpgradeDetector::UPGRADE_ANNOYANCE_HIGH:
|
| - severity = ash::UpdateObserver::UPDATE_HIGH_ORANGE;
|
| - break;
|
| -
|
| - case UpgradeDetector::UPGRADE_ANNOYANCE_ELEVATED:
|
| - severity = ash::UpdateObserver::UPDATE_LOW_GREEN;
|
| - break;
|
| -
|
| - case UpgradeDetector::UPGRADE_ANNOYANCE_LOW:
|
| - default:
|
| - severity = ash::UpdateObserver::UPDATE_NORMAL;
|
| - break;
|
| - }
|
| - GetSystemTrayNotifier()->NotifyUpdateRecommended(severity);
|
| + ash::UpdateInfo info;
|
| + GetUpdateInfo(content::Source<UpgradeDetector>(source).ptr(), &info);
|
| + GetSystemTrayNotifier()->NotifyUpdateRecommended(info);
|
| break;
|
| }
|
| case chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED: {
|
|
|