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

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

Issue 113303004: Disable the spring charger dialog on locked screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « no previous file | 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 (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/shell.h"
9 #include "ash/system/chromeos/power/power_status_view.h" 9 #include "ash/system/chromeos/power/power_status_view.h"
10 #include "ash/system/date/date_view.h" 10 #include "ash/system/date/date_view.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 void TrayPower::UpdateAfterLoginStatusChange(user::LoginStatus status) { 161 void TrayPower::UpdateAfterLoginStatusChange(user::LoginStatus status) {
162 } 162 }
163 163
164 void TrayPower::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) { 164 void TrayPower::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) {
165 SetTrayImageItemBorder(power_tray_, alignment); 165 SetTrayImageItemBorder(power_tray_, alignment);
166 } 166 }
167 167
168 void TrayPower::OnPowerStatusChanged() { 168 void TrayPower::OnPowerStatusChanged() {
169 RecordChargerType(); 169 RecordChargerType();
170 170
171 if (PowerStatus::Get()->IsOriginalSpringChargerConnected()) { 171 // TODO(jennyz): Enable showing spring charger dialog on locked screen after
172 // crbug.com/328593 is fixed.
173 user::LoginStatus login_status =
174 Shell::GetInstance()->system_tray_delegate()->GetUserLoginStatus();
175 if (PowerStatus::Get()->IsOriginalSpringChargerConnected() &&
176 (login_status != user::LOGGED_IN_NONE &&
177 login_status != user::LOGGED_IN_LOCKED)) {
172 ash::Shell::GetInstance()->system_tray_delegate()-> 178 ash::Shell::GetInstance()->system_tray_delegate()->
173 ShowSpringChargerReplacementDialog(); 179 ShowSpringChargerReplacementDialog();
174 } 180 }
175 181
176 bool battery_alert = UpdateNotificationState(); 182 bool battery_alert = UpdateNotificationState();
177 if (power_tray_) 183 if (power_tray_)
178 power_tray_->UpdateStatus(battery_alert); 184 power_tray_->UpdateStatus(battery_alert);
179 if (notification_view_) 185 if (notification_view_)
180 notification_view_->UpdateStatus(); 186 notification_view_->UpdateStatus();
181 187
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 338
333 if (current_charger != UNKNOWN_CHARGER) { 339 if (current_charger != UNKNOWN_CHARGER) {
334 UMA_HISTOGRAM_ENUMERATION("Power.ChargerType", 340 UMA_HISTOGRAM_ENUMERATION("Power.ChargerType",
335 current_charger, 341 current_charger,
336 CHARGER_TYPE_COUNT); 342 CHARGER_TYPE_COUNT);
337 } 343 }
338 } 344 }
339 345
340 } // namespace internal 346 } // namespace internal
341 } // namespace ash 347 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698