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

Side by Side Diff: chrome/browser/ui/views/toolbar/toolbar_button.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/ui/views/toolbar/toolbar_button.h" 5 #include "chrome/browser/ui/views/toolbar/toolbar_button.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 event->StopPropagation(); 123 event->StopPropagation();
124 return; 124 return;
125 } 125 }
126 126
127 LabelButton::OnGestureEvent(event); 127 LabelButton::OnGestureEvent(event);
128 } 128 }
129 129
130 void ToolbarButton::GetAccessibleNodeData(ui::AXNodeData* node_data) { 130 void ToolbarButton::GetAccessibleNodeData(ui::AXNodeData* node_data) {
131 CustomButton::GetAccessibleNodeData(node_data); 131 CustomButton::GetAccessibleNodeData(node_data);
132 node_data->role = ui::AX_ROLE_BUTTON_DROP_DOWN; 132 node_data->role = ui::AX_ROLE_BUTTON_DROP_DOWN;
133 node_data->AddStateFlag(ui::AX_STATE_HASPOPUP); 133 node_data->AddState(ui::AX_STATE_HASPOPUP);
134 if (enabled()) { 134 if (enabled()) {
135 node_data->AddIntAttribute(ui::AX_ATTR_ACTION, 135 node_data->AddIntAttribute(ui::AX_ATTR_ACTION,
136 ui::AX_SUPPORTED_ACTION_PRESS); 136 ui::AX_SUPPORTED_ACTION_PRESS);
137 } 137 }
138 } 138 }
139 139
140 std::unique_ptr<views::LabelButtonBorder> ToolbarButton::CreateDefaultBorder() 140 std::unique_ptr<views::LabelButtonBorder> ToolbarButton::CreateDefaultBorder()
141 const { 141 const {
142 std::unique_ptr<views::LabelButtonBorder> border = 142 std::unique_ptr<views::LabelButtonBorder> border =
143 views::LabelButton::CreateDefaultBorder(); 143 views::LabelButton::CreateDefaultBorder();
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 if (state() != STATE_DISABLED) 228 if (state() != STATE_DISABLED)
229 SetState(STATE_NORMAL); 229 SetState(STATE_NORMAL);
230 230
231 menu_runner_.reset(); 231 menu_runner_.reset();
232 menu_model_adapter_.reset(); 232 menu_model_adapter_.reset();
233 } 233 }
234 234
235 const char* ToolbarButton::GetClassName() const { 235 const char* ToolbarButton::GetClassName() const {
236 return "ToolbarButton"; 236 return "ToolbarButton";
237 } 237 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698