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

Side by Side Diff: ash/system/power/tray_power.cc

Issue 10690031: Turn of ash notification tray by default for M21. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1180/src/
Patch Set: Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « ash/ash_switches.cc ('k') | chrome/browser/about_flags.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/power/tray_power.h" 5 #include "ash/system/power/tray_power.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/system/date/date_view.h" 9 #include "ash/system/date/date_view.h"
10 #include "ash/system/power/power_status_view.h" 10 #include "ash/system/power/power_status_view.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 203
204 void TrayPower::UpdateAfterLoginStatusChange(user::LoginStatus status) { 204 void TrayPower::UpdateAfterLoginStatusChange(user::LoginStatus status) {
205 } 205 }
206 206
207 void TrayPower::OnPowerStatusChanged(const PowerSupplyStatus& status) { 207 void TrayPower::OnPowerStatusChanged(const PowerSupplyStatus& status) {
208 if (power_tray_) 208 if (power_tray_)
209 power_tray_->UpdatePowerStatus(status); 209 power_tray_->UpdatePowerStatus(status);
210 if (notification_view_) 210 if (notification_view_)
211 notification_view_->UpdatePowerStatus(status); 211 notification_view_->UpdatePowerStatus(status);
212 212
213 if (!CommandLine::ForCurrentProcess()->HasSwitch( 213 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshNotify)) {
214 switches::kAshNotifyDisabled)) {
215 if (UpdateNotificationState(status)) 214 if (UpdateNotificationState(status))
216 ShowNotificationView(); 215 ShowNotificationView();
217 else if (notification_state_ == NOTIFICATION_NONE) 216 else if (notification_state_ == NOTIFICATION_NONE)
218 HideNotificationView(); 217 HideNotificationView();
219 } 218 }
220 } 219 }
221 220
222 bool TrayPower::UpdateNotificationState(const PowerSupplyStatus& status) { 221 bool TrayPower::UpdateNotificationState(const PowerSupplyStatus& status) {
223 if (!status.battery_is_present || 222 if (!status.battery_is_present ||
224 status.is_calculating_battery_time || 223 status.is_calculating_battery_time ||
(...skipping 26 matching lines...) Expand all
251 return false; 250 return false;
252 case NOTIFICATION_CRITICAL: 251 case NOTIFICATION_CRITICAL:
253 return false; 252 return false;
254 } 253 }
255 NOTREACHED(); 254 NOTREACHED();
256 return false; 255 return false;
257 } 256 }
258 257
259 } // namespace internal 258 } // namespace internal
260 } // namespace ash 259 } // namespace ash
OLDNEW
« no previous file with comments | « ash/ash_switches.cc ('k') | chrome/browser/about_flags.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698