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

Side by Side Diff: ash/system/chromeos/settings/tray_settings.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
« no previous file with comments | « ash/system/chromeos/power/tray_power.cc ('k') | ash/system/tray/system_tray.h » ('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/chromeos/settings/tray_settings.h" 5 #include "ash/system/chromeos/settings/tray_settings.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/system/chromeos/power/power_status.h" 8 #include "ash/system/chromeos/power/power_status.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/tray/actionable_view.h" 10 #include "ash/system/tray/actionable_view.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 Layout(); 101 Layout();
102 } 102 }
103 103
104 // Overridden from PowerStatus::Observer. 104 // Overridden from PowerStatus::Observer.
105 virtual void OnPowerStatusChanged() OVERRIDE { 105 virtual void OnPowerStatusChanged() OVERRIDE {
106 if (!PowerStatus::Get()->IsBatteryPresent()) 106 if (!PowerStatus::Get()->IsBatteryPresent())
107 return; 107 return;
108 108
109 base::string16 accessible_name = label_ ? 109 base::string16 accessible_name = label_ ?
110 label_->text() + base::ASCIIToUTF16(", ") + 110 label_->text() + base::ASCIIToUTF16(", ") +
111 PowerStatus::Get()->GetAccessibleNameString() : 111 PowerStatus::Get()->GetAccessibleNameString(true) :
112 PowerStatus::Get()->GetAccessibleNameString(); 112 PowerStatus::Get()->GetAccessibleNameString(true);
113 SetAccessibleName(accessible_name); 113 SetAccessibleName(accessible_name);
114 } 114 }
115 115
116 private: 116 private:
117 user::LoginStatus login_status_; 117 user::LoginStatus login_status_;
118 views::Label* label_; 118 views::Label* label_;
119 ash::PowerStatusView* power_status_view_; 119 ash::PowerStatusView* power_status_view_;
120 120
121 DISALLOW_COPY_AND_ASSIGN(SettingsDefaultView); 121 DISALLOW_COPY_AND_ASSIGN(SettingsDefaultView);
122 }; 122 };
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 default_view_ = NULL; 158 default_view_ = NULL;
159 } 159 }
160 160
161 void TraySettings::DestroyDetailedView() { 161 void TraySettings::DestroyDetailedView() {
162 } 162 }
163 163
164 void TraySettings::UpdateAfterLoginStatusChange(user::LoginStatus status) { 164 void TraySettings::UpdateAfterLoginStatusChange(user::LoginStatus status) {
165 } 165 }
166 166
167 } // namespace ash 167 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/power/tray_power.cc ('k') | ash/system/tray/system_tray.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698