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

Side by Side Diff: ash/system/audio/volume_view.cc

Issue 2860883003: A11y: Add/refactor methods for manipulating bitfields on AXNodeData. (Closed)
Patch Set: Delete AXNodeData::Init() and clear bitfields in AXNodeData() instead. Created 3 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/audio/volume_view.h" 5 #include "ash/system/audio/volume_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/metrics/user_metrics_action.h" 9 #include "ash/metrics/user_metrics_action.h"
10 #include "ash/resources/vector_icons/vector_icons.h" 10 #include "ash/resources/vector_icons/vector_icons.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 image_index_ = image_index; 94 image_index_ = image_index;
95 } 95 }
96 96
97 private: 97 private:
98 // views::View: 98 // views::View:
99 void GetAccessibleNodeData(ui::AXNodeData* node_data) override { 99 void GetAccessibleNodeData(ui::AXNodeData* node_data) override {
100 node_data->SetName( 100 node_data->SetName(
101 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_VOLUME_MUTE)); 101 l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_VOLUME_MUTE));
102 node_data->role = ui::AX_ROLE_TOGGLE_BUTTON; 102 node_data->role = ui::AX_ROLE_TOGGLE_BUTTON;
103 if (CrasAudioHandler::Get()->IsOutputMuted()) 103 if (CrasAudioHandler::Get()->IsOutputMuted())
104 node_data->AddStateFlag(ui::AX_STATE_PRESSED); 104 node_data->AddState(ui::AX_STATE_PRESSED);
105 } 105 }
106 106
107 views::ImageView* image_; 107 views::ImageView* image_;
108 int image_index_; 108 int image_index_;
109 109
110 DISALLOW_COPY_AND_ASSIGN(VolumeButton); 110 DISALLOW_COPY_AND_ASSIGN(VolumeButton);
111 }; 111 };
112 112
113 VolumeView::VolumeView(SystemTrayItem* owner, 113 VolumeView::VolumeView(SystemTrayItem* owner,
114 bool is_default_view) 114 bool is_default_view)
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 if (new_volume > current_volume) 274 if (new_volume > current_volume)
275 HandleVolumeUp(new_volume); 275 HandleVolumeUp(new_volume);
276 else 276 else
277 HandleVolumeDown(new_volume); 277 HandleVolumeDown(new_volume);
278 } 278 }
279 icon_->Update(); 279 icon_->Update();
280 } 280 }
281 281
282 } // namespace tray 282 } // namespace tray
283 } // namespace ash 283 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/system/ime_menu/ime_menu_tray_unittest.cc » ('j') | ui/views/accessibility/ax_view_obj_wrapper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698