Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Side by Side Diff: chrome/browser/ui/ash/system_tray_client.cc

Issue 2720613007: Chrome OS component updater: UpdateSeverity::LOW (Closed)
Patch Set: Update test details Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 } 352 }
353 353
354 void SystemTrayClient::HandleUpdateAvailable() { 354 void SystemTrayClient::HandleUpdateAvailable() {
355 // Show an update icon for Chrome updates and Flash component updates. 355 // Show an update icon for Chrome updates and Flash component updates.
356 UpgradeDetector* detector = UpgradeDetector::GetInstance(); 356 UpgradeDetector* detector = UpgradeDetector::GetInstance();
357 DCHECK(detector->notify_upgrade() || flash_update_available_); 357 DCHECK(detector->notify_upgrade() || flash_update_available_);
358 358
359 // Get the Chrome update severity. 359 // Get the Chrome update severity.
360 ash::mojom::UpdateSeverity severity = GetUpdateSeverity(detector); 360 ash::mojom::UpdateSeverity severity = GetUpdateSeverity(detector);
361 361
362 // Flash updates are elevated severity unless the Chrome severity is higher. 362 // Flash updates are low severity unless the Chrome severity is higher.
363 if (flash_update_available_) 363 if (flash_update_available_)
364 severity = std::max(severity, ash::mojom::UpdateSeverity::ELEVATED); 364 severity = std::max(severity, ash::mojom::UpdateSeverity::LOW);
365 365
366 system_tray_->ShowUpdateIcon(severity, detector->is_factory_reset_required()); 366 system_tray_->ShowUpdateIcon(severity, detector->is_factory_reset_required());
367 } 367 }
368 368
369 //////////////////////////////////////////////////////////////////////////////// 369 ////////////////////////////////////////////////////////////////////////////////
370 // chromeos::system::SystemClockObserver: 370 // chromeos::system::SystemClockObserver:
371 371
372 void SystemTrayClient::OnSystemClockChanged( 372 void SystemTrayClient::OnSystemClockChanged(
373 chromeos::system::SystemClock* clock) { 373 chromeos::system::SystemClock* clock) {
374 system_tray_->SetUse24HourClock(clock->ShouldUse24HourClock()); 374 system_tray_->SetUse24HourClock(clock->ShouldUse24HourClock());
375 } 375 }
376 376
377 void SystemTrayClient::Observe(int type, 377 void SystemTrayClient::Observe(int type,
378 const content::NotificationSource& source, 378 const content::NotificationSource& source,
379 const content::NotificationDetails& details) { 379 const content::NotificationDetails& details) {
380 DCHECK_EQ(chrome::NOTIFICATION_UPGRADE_RECOMMENDED, type); 380 DCHECK_EQ(chrome::NOTIFICATION_UPGRADE_RECOMMENDED, type);
381 HandleUpdateAvailable(); 381 HandleUpdateAvailable();
382 } 382 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698