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

Side by Side Diff: ash/common/system/chromeos/power/power_status_view.cc

Issue 2477463003: Replace ui::AXViewState with AXNodeData and AXActionData (Closed)
Patch Set: Fix test Created 4 years, 1 month 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/common/system/chromeos/power/power_status_view.h" 5 #include "ash/common/system/chromeos/power/power_status_view.h"
6 6
7 #include "ash/common/material_design/material_design_controller.h" 7 #include "ash/common/material_design/material_design_controller.h"
8 #include "ash/common/system/chromeos/power/power_status.h" 8 #include "ash/common/system/chromeos/power/power_status.h"
9 #include "ash/common/system/chromeos/power/tray_power.h" 9 #include "ash/common/system/chromeos/power/tray_power.h"
10 #include "ash/common/system/tray/fixed_sized_image_view.h" 10 #include "ash/common/system/tray/fixed_sized_image_view.h"
11 #include "ash/common/system/tray/tray_constants.h" 11 #include "ash/common/system/tray/tray_constants.h"
12 #include "ash/common/system/tray/tray_popup_item_style.h" 12 #include "ash/common/system/tray/tray_popup_item_style.h"
13 #include "base/i18n/number_formatting.h" 13 #include "base/i18n/number_formatting.h"
14 #include "base/i18n/time_formatting.h" 14 #include "base/i18n/time_formatting.h"
15 #include "base/strings/utf_string_conversions.h" 15 #include "base/strings/utf_string_conversions.h"
16 #include "grit/ash_strings.h" 16 #include "grit/ash_strings.h"
17 #include "ui/accessibility/ax_view_state.h" 17 #include "ui/accessibility/ax_node_data.h"
18 #include "ui/base/l10n/l10n_util.h" 18 #include "ui/base/l10n/l10n_util.h"
19 #include "ui/native_theme/native_theme.h" 19 #include "ui/native_theme/native_theme.h"
20 #include "ui/views/controls/image_view.h" 20 #include "ui/views/controls/image_view.h"
21 #include "ui/views/controls/label.h" 21 #include "ui/views/controls/label.h"
22 #include "ui/views/layout/box_layout.h" 22 #include "ui/views/layout/box_layout.h"
23 #include "ui/views/layout/grid_layout.h" 23 #include "ui/views/layout/grid_layout.h"
24 24
25 namespace ash { 25 namespace ash {
26 26
27 // Padding between battery status text and battery icon on default view. 27 // Padding between battery status text and battery icon on default view.
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 percentage_label_->visible() && time_status_label_->visible()) { 173 percentage_label_->visible() && time_status_label_->visible()) {
174 separator_label_->SetX(percentage_label_->bounds().right() + 1); 174 separator_label_->SetX(percentage_label_->bounds().right() + 1);
175 time_status_label_->SetX(separator_label_->bounds().right() + 1); 175 time_status_label_->SetX(separator_label_->bounds().right() + 1);
176 } 176 }
177 } 177 }
178 178
179 void PowerStatusView::OnNativeThemeChanged(const ui::NativeTheme* theme) { 179 void PowerStatusView::OnNativeThemeChanged(const ui::NativeTheme* theme) {
180 UpdateStyle(); 180 UpdateStyle();
181 } 181 }
182 182
183 void PowerStatusView::GetAccessibleState(ui::AXViewState* state) { 183 void PowerStatusView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
184 if (!MaterialDesignController::IsSystemTrayMenuMaterial()) 184 if (!MaterialDesignController::IsSystemTrayMenuMaterial())
185 return; 185 return;
186 186
187 state->role = ui::AX_ROLE_LABEL_TEXT; 187 node_data->role = ui::AX_ROLE_LABEL_TEXT;
188 state->name = accessible_name_; 188 node_data->SetName(accessible_name_);
189 } 189 }
190 190
191 } // namespace ash 191 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/chromeos/power/power_status_view.h ('k') | ash/common/system/chromeos/power/tray_power.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698