| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "chrome/browser/ui/ash/system_tray_client.h" | 5 #include "chrome/browser/ui/ash/system_tray_client.h" |
| 6 | 6 |
| 7 #include "ash/common/login_status.h" | 7 #include "ash/common/login_status.h" |
| 8 #include "ash/common/wm_shell.h" | 8 #include "ash/common/wm_shell.h" |
| 9 #include "ash/public/cpp/shell_window_ids.h" | 9 #include "ash/public/cpp/shell_window_ids.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 } | 350 } |
| 351 | 351 |
| 352 void SystemTrayClient::HandleUpdateAvailable() { | 352 void SystemTrayClient::HandleUpdateAvailable() { |
| 353 // Show an update icon for Chrome updates and Flash component updates. | 353 // Show an update icon for Chrome updates and Flash component updates. |
| 354 UpgradeDetector* detector = UpgradeDetector::GetInstance(); | 354 UpgradeDetector* detector = UpgradeDetector::GetInstance(); |
| 355 DCHECK(detector->notify_upgrade() || flash_update_available_); | 355 DCHECK(detector->notify_upgrade() || flash_update_available_); |
| 356 | 356 |
| 357 // Get the Chrome update severity. | 357 // Get the Chrome update severity. |
| 358 ash::mojom::UpdateSeverity severity = GetUpdateSeverity(detector); | 358 ash::mojom::UpdateSeverity severity = GetUpdateSeverity(detector); |
| 359 | 359 |
| 360 // Flash updates are elevated severity unless the Chrome severity is higher. | 360 // Flash updates are low severity unless the Chrome severity is higher. |
| 361 if (flash_update_available_) | 361 if (flash_update_available_) |
| 362 severity = std::max(severity, ash::mojom::UpdateSeverity::ELEVATED); | 362 severity = std::max(severity, ash::mojom::UpdateSeverity::LOW); |
| 363 | 363 |
| 364 system_tray_->ShowUpdateIcon(severity, detector->is_factory_reset_required()); | 364 system_tray_->ShowUpdateIcon(severity, detector->is_factory_reset_required()); |
| 365 } | 365 } |
| 366 | 366 |
| 367 //////////////////////////////////////////////////////////////////////////////// | 367 //////////////////////////////////////////////////////////////////////////////// |
| 368 // chromeos::system::SystemClockObserver: | 368 // chromeos::system::SystemClockObserver: |
| 369 | 369 |
| 370 void SystemTrayClient::OnSystemClockChanged( | 370 void SystemTrayClient::OnSystemClockChanged( |
| 371 chromeos::system::SystemClock* clock) { | 371 chromeos::system::SystemClock* clock) { |
| 372 system_tray_->SetUse24HourClock(clock->ShouldUse24HourClock()); | 372 system_tray_->SetUse24HourClock(clock->ShouldUse24HourClock()); |
| 373 } | 373 } |
| 374 | 374 |
| 375 void SystemTrayClient::Observe(int type, | 375 void SystemTrayClient::Observe(int type, |
| 376 const content::NotificationSource& source, | 376 const content::NotificationSource& source, |
| 377 const content::NotificationDetails& details) { | 377 const content::NotificationDetails& details) { |
| 378 DCHECK_EQ(chrome::NOTIFICATION_UPGRADE_RECOMMENDED, type); | 378 DCHECK_EQ(chrome::NOTIFICATION_UPGRADE_RECOMMENDED, type); |
| 379 HandleUpdateAvailable(); | 379 HandleUpdateAvailable(); |
| 380 } | 380 } |
| OLD | NEW |