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

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

Issue 2816253002: Display "Restart to update Adobe Flash Player" for Flash updates. (Closed)
Patch Set: Fix nits from last review Created 3 years, 8 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 | « ash/system/update/tray_update_unittest.cc ('k') | 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/login_status.h" 7 #include "ash/login_status.h"
8 #include "ash/public/cpp/shell_window_ids.h" 8 #include "ash/public/cpp/shell_window_ids.h"
9 #include "ash/public/interfaces/constants.mojom.h" 9 #include "ash/public/interfaces/constants.mojom.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 const chrome::RebootPolicy reboot_policy = 373 const chrome::RebootPolicy reboot_policy =
374 flash_update_available_ ? chrome::RebootPolicy::kForceReboot 374 flash_update_available_ ? chrome::RebootPolicy::kForceReboot
375 : chrome::RebootPolicy::kOptionalReboot; 375 : chrome::RebootPolicy::kOptionalReboot;
376 376
377 chrome::NotifyAndTerminate(true /* fast_path */, reboot_policy); 377 chrome::NotifyAndTerminate(true /* fast_path */, reboot_policy);
378 } 378 }
379 379
380 void SystemTrayClient::HandleUpdateAvailable() { 380 void SystemTrayClient::HandleUpdateAvailable() {
381 // Show an update icon for Chrome updates and Flash component updates. 381 // Show an update icon for Chrome updates and Flash component updates.
382 UpgradeDetector* detector = UpgradeDetector::GetInstance(); 382 UpgradeDetector* detector = UpgradeDetector::GetInstance();
383 DCHECK(detector->notify_upgrade() || flash_update_available_); 383 bool update_available = detector->notify_upgrade() || flash_update_available_;
384 DCHECK(update_available);
385 if (!update_available)
386 return;
384 387
385 // Get the Chrome update severity. 388 // Get the Chrome update severity.
386 ash::mojom::UpdateSeverity severity = GetUpdateSeverity(detector); 389 ash::mojom::UpdateSeverity severity = GetUpdateSeverity(detector);
387 390
388 // Flash updates are low severity unless the Chrome severity is higher. 391 // Flash updates are low severity unless the Chrome severity is higher.
389 if (flash_update_available_) 392 if (flash_update_available_)
390 severity = std::max(severity, ash::mojom::UpdateSeverity::LOW); 393 severity = std::max(severity, ash::mojom::UpdateSeverity::LOW);
391 394
392 system_tray_->ShowUpdateIcon(severity, detector->is_factory_reset_required()); 395 // Show a string specific to updating flash player if there is no system
396 // update.
397 ash::mojom::UpdateType update_type = detector->notify_upgrade()
398 ? ash::mojom::UpdateType::SYSTEM
399 : ash::mojom::UpdateType::FLASH;
400
401 system_tray_->ShowUpdateIcon(severity, detector->is_factory_reset_required(),
402 update_type);
393 } 403 }
394 404
395 //////////////////////////////////////////////////////////////////////////////// 405 ////////////////////////////////////////////////////////////////////////////////
396 // chromeos::system::SystemClockObserver: 406 // chromeos::system::SystemClockObserver:
397 407
398 void SystemTrayClient::OnSystemClockChanged( 408 void SystemTrayClient::OnSystemClockChanged(
399 chromeos::system::SystemClock* clock) { 409 chromeos::system::SystemClock* clock) {
400 system_tray_->SetUse24HourClock(clock->ShouldUse24HourClock()); 410 system_tray_->SetUse24HourClock(clock->ShouldUse24HourClock());
401 } 411 }
402 412
403 void SystemTrayClient::Observe(int type, 413 void SystemTrayClient::Observe(int type,
404 const content::NotificationSource& source, 414 const content::NotificationSource& source,
405 const content::NotificationDetails& details) { 415 const content::NotificationDetails& details) {
406 DCHECK_EQ(chrome::NOTIFICATION_UPGRADE_RECOMMENDED, type); 416 DCHECK_EQ(chrome::NOTIFICATION_UPGRADE_RECOMMENDED, type);
407 HandleUpdateAvailable(); 417 HandleUpdateAvailable();
408 } 418 }
OLDNEW
« no previous file with comments | « ash/system/update/tray_update_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698