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

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

Issue 107103004: Implement the spring charger replacement UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits. Created 7 years 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
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/chromeos/power/tray_power.h" 5 #include "ash/system/chromeos/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/system/chromeos/power/power_status_view.h" 9 #include "ash/system/chromeos/power/power_status_view.h"
9 #include "ash/system/date/date_view.h" 10 #include "ash/system/date/date_view.h"
10 #include "ash/system/system_notifier.h" 11 #include "ash/system/system_notifier.h"
12 #include "ash/system/tray/system_tray_delegate.h"
11 #include "ash/system/tray/tray_constants.h" 13 #include "ash/system/tray/tray_constants.h"
12 #include "ash/system/tray/tray_notification_view.h" 14 #include "ash/system/tray/tray_notification_view.h"
13 #include "ash/system/tray/tray_utils.h" 15 #include "ash/system/tray/tray_utils.h"
14 #include "base/command_line.h" 16 #include "base/command_line.h"
15 #include "grit/ash_resources.h" 17 #include "grit/ash_resources.h"
16 #include "grit/ash_strings.h" 18 #include "grit/ash_strings.h"
17 #include "third_party/icu/source/i18n/unicode/fieldpos.h" 19 #include "third_party/icu/source/i18n/unicode/fieldpos.h"
18 #include "third_party/icu/source/i18n/unicode/fmtable.h" 20 #include "third_party/icu/source/i18n/unicode/fmtable.h"
19 #include "ui/base/accessibility/accessible_view_state.h" 21 #include "ui/base/accessibility/accessible_view_state.h"
20 #include "ui/base/resource/resource_bundle.h" 22 #include "ui/base/resource/resource_bundle.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 } 157 }
156 158
157 void TrayPower::UpdateAfterLoginStatusChange(user::LoginStatus status) { 159 void TrayPower::UpdateAfterLoginStatusChange(user::LoginStatus status) {
158 } 160 }
159 161
160 void TrayPower::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) { 162 void TrayPower::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) {
161 SetTrayImageItemBorder(power_tray_, alignment); 163 SetTrayImageItemBorder(power_tray_, alignment);
162 } 164 }
163 165
164 void TrayPower::OnPowerStatusChanged() { 166 void TrayPower::OnPowerStatusChanged() {
167 // Show spring charger replacement dialog if necessary.
Daniel Erat 2013/12/06 18:45:24 nit: remove unnecessary comment
jennyz 2013/12/06 19:11:36 Done.
168 if (PowerStatus::Get()->IsOriginalSpringChargerConnected()) {
169 ash::Shell::GetInstance()->system_tray_delegate()->
170 ShowSpringChargerReplacementDialog();
171 }
172
165 bool battery_alert = UpdateNotificationState(); 173 bool battery_alert = UpdateNotificationState();
166 if (power_tray_) 174 if (power_tray_)
167 power_tray_->UpdateStatus(battery_alert); 175 power_tray_->UpdateStatus(battery_alert);
168 if (notification_view_) 176 if (notification_view_)
169 notification_view_->UpdateStatus(); 177 notification_view_->UpdateStatus();
170 178
171 // Factory testing may place the battery into unusual states. 179 // Factory testing may place the battery into unusual states.
172 if (CommandLine::ForCurrentProcess()->HasSwitch( 180 if (CommandLine::ForCurrentProcess()->HasSwitch(
173 ash::switches::kAshHideNotificationsForFactory)) 181 ash::switches::kAshHideNotificationsForFactory))
174 return; 182 return;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 return false; 302 return false;
295 case NOTIFICATION_CRITICAL: 303 case NOTIFICATION_CRITICAL:
296 return false; 304 return false;
297 } 305 }
298 NOTREACHED(); 306 NOTREACHED();
299 return false; 307 return false;
300 } 308 }
301 309
302 } // namespace internal 310 } // namespace internal
303 } // namespace ash 311 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/power/power_status.cc ('k') | ash/system/tray/default_system_tray_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698