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

Side by Side Diff: ash/system/tray/system_tray_controller.cc

Issue 2882933002: Add update available icon in system tray (Closed)
Patch Set: 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 unified diff | Download patch
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 "ash/system/tray/system_tray_controller.h" 5 #include "ash/system/tray/system_tray_controller.h"
6 6
7 #include "ash/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell_port.h" 9 #include "ash/shell_port.h"
10 #include "ash/system/tray/system_tray.h" 10 #include "ash/system/tray/system_tray.h"
(...skipping 27 matching lines...) Expand all
38 system_tray_client_->ShowBluetoothPairingDialog(address, name_for_display, 38 system_tray_client_->ShowBluetoothPairingDialog(address, name_for_display,
39 paired, connected); 39 paired, connected);
40 } 40 }
41 } 41 }
42 42
43 void SystemTrayController::ShowDateSettings() { 43 void SystemTrayController::ShowDateSettings() {
44 if (system_tray_client_) 44 if (system_tray_client_)
45 system_tray_client_->ShowDateSettings(); 45 system_tray_client_->ShowDateSettings();
46 } 46 }
47 47
48 void SystemTrayController::ShowAboutChromeOS() {
49 if (system_tray_client_)
50 system_tray_client_->ShowAboutChromeOS();
51 }
52
48 void SystemTrayController::ShowSetTimeDialog() { 53 void SystemTrayController::ShowSetTimeDialog() {
49 if (system_tray_client_) 54 if (system_tray_client_)
50 system_tray_client_->ShowSetTimeDialog(); 55 system_tray_client_->ShowSetTimeDialog();
51 } 56 }
52 57
53 void SystemTrayController::ShowDisplaySettings() { 58 void SystemTrayController::ShowDisplaySettings() {
54 if (system_tray_client_) 59 if (system_tray_client_)
55 system_tray_client_->ShowDisplaySettings(); 60 system_tray_client_->ShowDisplaySettings();
56 } 61 }
57 62
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 void SystemTrayController::SignOut() { 139 void SystemTrayController::SignOut() {
135 if (system_tray_client_) 140 if (system_tray_client_)
136 system_tray_client_->SignOut(); 141 system_tray_client_->SignOut();
137 } 142 }
138 143
139 void SystemTrayController::RequestRestartForUpdate() { 144 void SystemTrayController::RequestRestartForUpdate() {
140 if (system_tray_client_) 145 if (system_tray_client_)
141 system_tray_client_->RequestRestartForUpdate(); 146 system_tray_client_->RequestRestartForUpdate();
142 } 147 }
143 148
149 void SystemTrayController::RequestUpdateCheck() {
150 if (system_tray_client_)
151 system_tray_client_->RequestUpdateCheck();
152 }
153
144 void SystemTrayController::BindRequest(mojom::SystemTrayRequest request) { 154 void SystemTrayController::BindRequest(mojom::SystemTrayRequest request) {
145 bindings_.AddBinding(this, std::move(request)); 155 bindings_.AddBinding(this, std::move(request));
146 } 156 }
147 157
148 void SystemTrayController::SetClient(mojom::SystemTrayClientPtr client) { 158 void SystemTrayController::SetClient(mojom::SystemTrayClientPtr client) {
149 system_tray_client_ = std::move(client); 159 system_tray_client_ = std::move(client);
150 } 160 }
151 161
152 void SystemTrayController::SetPrimaryTrayEnabled(bool enabled) { 162 void SystemTrayController::SetPrimaryTrayEnabled(bool enabled) {
153 ash::SystemTray* tray = 163 ash::SystemTray* tray =
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 for (WmWindow* root : ShellPort::Get()->GetAllRootWindows()) { 213 for (WmWindow* root : ShellPort::Get()->GetAllRootWindows()) {
204 ash::SystemTray* tray = root->GetRootWindowController()->GetSystemTray(); 214 ash::SystemTray* tray = root->GetRootWindowController()->GetSystemTray();
205 // External monitors might not have a tray yet. 215 // External monitors might not have a tray yet.
206 if (!tray) 216 if (!tray)
207 continue; 217 continue;
208 tray->tray_update()->ShowUpdateIcon(severity, factory_reset_required, 218 tray->tray_update()->ShowUpdateIcon(severity, factory_reset_required,
209 update_type); 219 update_type);
210 } 220 }
211 } 221 }
212 222
223 void SystemTrayController::ShowUpdateOverCellularAvailableIcon() {
224 // Show the icon on all displays.
225 for (WmWindow* root : ShellPort::Get()->GetAllRootWindows()) {
226 ash::SystemTray* tray = root->GetRootWindowController()->GetSystemTray();
227 // External monitors might not have a tray yet.
228 if (!tray)
229 continue;
230 tray->tray_update()->ShowUpdateOverCellularAvailableIcon();
231 }
232 }
233
213 } // namespace ash 234 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698