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

Unified Diff: chrome/browser/ui/ash/system_tray_client.cc

Issue 2882933002: Add update available icon in system tray (Closed)
Patch Set: Add update available icon in system tray Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/system_tray_client.cc
diff --git a/chrome/browser/ui/ash/system_tray_client.cc b/chrome/browser/ui/ash/system_tray_client.cc
index be329e66571038c8989acefceb70d21492aa2b3c..ede77f051dff858351894f8ae4b6946a1d118303 100644
--- a/chrome/browser/ui/ash/system_tray_client.cc
+++ b/chrome/browser/ui/ash/system_tray_client.cc
@@ -10,6 +10,7 @@
#include "ash/shell.h"
#include "base/feature_list.h"
#include "base/logging.h"
+#include "base/memory/weak_ptr.h"
#include "base/metrics/user_metrics.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_process_platform_part.h"
@@ -61,6 +62,7 @@
using chromeos::BluetoothPairingDialog;
using chromeos::DBusThreadManager;
using chromeos::LoginState;
+using chromeos::UpdateEngineClient;
using device::BluetoothDevice;
using views::Widget;
@@ -108,6 +110,8 @@ SystemTrayClient::SystemTrayClient() : binding_(this) {
registrar_.Add(this, chrome::NOTIFICATION_UPGRADE_RECOMMENDED,
content::NotificationService::AllSources());
+ registrar_.Add(this, chrome::NOTIFICATION_UPDATE_OVER_CELLULAR_AVAILABLE,
+ content::NotificationService::AllSources());
// If an upgrade is available at startup then tell ash about it.
if (UpgradeDetector::GetInstance()->notify_upgrade())
@@ -294,6 +298,12 @@ void SystemTrayClient::ShowIMESettings() {
ShowSettingsSubPageForActiveUser(chrome::kLanguageOptionsSubPage);
}
+void SystemTrayClient::ShowAboutChromeOS(bool check_for_update) {
+ std::string sub_page = chrome::kHelpSubPage;
+ sub_page += (check_for_update ? "?checkForUpdate=true" : "");
stevenjb 2017/05/17 16:56:31 With the parameter removed, you can just add a com
weidongg 2017/05/17 18:33:37 Done.
+ ShowSettingsSubPageForActiveUser(sub_page);
+}
+
void SystemTrayClient::ShowHelp() {
chrome::ShowHelpForProfile(ProfileManager::GetActiveUserProfile(),
chrome::HELP_SOURCE_MENU);
@@ -460,6 +470,10 @@ void SystemTrayClient::HandleUpdateAvailable() {
update_type);
}
+void SystemTrayClient::HandleUpdateOverCellularAvailable() {
+ system_tray_->ShowUpdateOverCellularAvailableIcon();
+}
+
////////////////////////////////////////////////////////////////////////////////
// chromeos::system::SystemClockObserver:
@@ -471,8 +485,10 @@ void SystemTrayClient::OnSystemClockChanged(
void SystemTrayClient::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- DCHECK_EQ(chrome::NOTIFICATION_UPGRADE_RECOMMENDED, type);
- HandleUpdateAvailable();
+ if (chrome::NOTIFICATION_UPGRADE_RECOMMENDED == type)
+ HandleUpdateAvailable();
+ else if (chrome::NOTIFICATION_UPDATE_OVER_CELLULAR_AVAILABLE == type)
+ HandleUpdateOverCellularAvailable();
}
////////////////////////////////////////////////////////////////////////////////

Powered by Google App Engine
This is Rietveld 408576698