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

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

Issue 380943002: Added battery level and time to the status tray's accessible name. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed old view before storing a new one Created 6 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
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/accessibility_delegate.h" 7 #include "ash/accessibility_delegate.h"
8 #include "ash/ash_switches.h" 8 #include "ash/ash_switches.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/system/chromeos/power/power_status_view.h" 10 #include "ash/system/chromeos/power/power_status_view.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE { 62 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE {
63 state->name = accessible_name_; 63 state->name = accessible_name_;
64 state->role = ui::AX_ROLE_BUTTON; 64 state->role = ui::AX_ROLE_BUTTON;
65 } 65 }
66 66
67 void UpdateStatus(bool battery_alert) { 67 void UpdateStatus(bool battery_alert) {
68 UpdateImage(); 68 UpdateImage();
69 SetVisible(PowerStatus::Get()->IsBatteryPresent()); 69 SetVisible(PowerStatus::Get()->IsBatteryPresent());
70 70
71 if (battery_alert) { 71 if (battery_alert) {
72 accessible_name_ = PowerStatus::Get()->GetAccessibleNameString(); 72 accessible_name_ = PowerStatus::Get()->GetAccessibleNameString(true);
73 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); 73 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true);
74 } 74 }
75 } 75 }
76 76
77 void SetupNotifyBadCharger() { 77 void SetupNotifyBadCharger() {
78 // Poll with a shorter duration timer to notify the charger issue 78 // Poll with a shorter duration timer to notify the charger issue
79 // for the first time after the charger dialog is displayed. 79 // for the first time after the charger dialog is displayed.
80 spring_charger_accessility_timer_.Start( 80 spring_charger_accessility_timer_.Start(
81 FROM_HERE, base::TimeDelta::FromSeconds( 81 FROM_HERE, base::TimeDelta::FromSeconds(
82 kSpringChargerAccessibilityTimerFirstTimeNotifyInSeconds), 82 kSpringChargerAccessibilityTimerFirstTimeNotifyInSeconds),
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 } 389 }
390 390
391 if (current_charger != UNKNOWN_CHARGER) { 391 if (current_charger != UNKNOWN_CHARGER) {
392 UMA_HISTOGRAM_ENUMERATION("Power.ChargerType", 392 UMA_HISTOGRAM_ENUMERATION("Power.ChargerType",
393 current_charger, 393 current_charger,
394 CHARGER_TYPE_COUNT); 394 CHARGER_TYPE_COUNT);
395 } 395 }
396 } 396 }
397 397
398 } // namespace ash 398 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/power/power_status.cc ('k') | ash/system/chromeos/settings/tray_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698