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

Side by Side Diff: ui/views/controls/tabbed_pane/tabbed_pane.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 (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 "ui/views/controls/tabbed_pane/tabbed_pane.h" 5 #include "ui/views/controls/tabbed_pane/tabbed_pane.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "cc/paint/paint_flags.h" 9 #include "cc/paint/paint_flags.h"
10 #include "third_party/skia/include/core/SkPath.h" 10 #include "third_party/skia/include/core/SkPath.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 if (tab_state == tab_state_) 221 if (tab_state == tab_state_)
222 return; 222 return;
223 tab_state_ = tab_state; 223 tab_state_ = tab_state;
224 OnStateChanged(); 224 OnStateChanged();
225 SchedulePaint(); 225 SchedulePaint();
226 } 226 }
227 227
228 void Tab::GetAccessibleNodeData(ui::AXNodeData* data) { 228 void Tab::GetAccessibleNodeData(ui::AXNodeData* data) {
229 data->role = ui::AX_ROLE_TAB; 229 data->role = ui::AX_ROLE_TAB;
230 data->SetName(title()->text()); 230 data->SetName(title()->text());
231 data->AddStateFlag(ui::AX_STATE_SELECTABLE); 231 data->AddState(ui::AX_STATE_SELECTABLE);
232 if (selected()) 232 if (selected())
233 data->AddStateFlag(ui::AX_STATE_SELECTED); 233 data->AddState(ui::AX_STATE_SELECTED);
234 } 234 }
235 235
236 bool Tab::HandleAccessibleAction(const ui::AXActionData& action_data) { 236 bool Tab::HandleAccessibleAction(const ui::AXActionData& action_data) {
237 if (action_data.action != ui::AX_ACTION_SET_SELECTION || !enabled()) 237 if (action_data.action != ui::AX_ACTION_SET_SELECTION || !enabled())
238 return false; 238 return false;
239 239
240 // It's not clear what should happen if a tab is 'deselected', so the 240 // It's not clear what should happen if a tab is 'deselected', so the
241 // AX_ACTION_SET_SELECTION action will always select the tab. 241 // AX_ACTION_SET_SELECTION action will always select the tab.
242 tabbed_pane_->SelectTab(this); 242 tabbed_pane_->SelectTab(this);
243 return true; 243 return true;
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 624
625 View* TabbedPane::GetSelectedTabContentView() { 625 View* TabbedPane::GetSelectedTabContentView() {
626 return GetSelectedTab() ? GetSelectedTab()->contents() : nullptr; 626 return GetSelectedTab() ? GetSelectedTab()->contents() : nullptr;
627 } 627 }
628 628
629 void TabbedPane::GetAccessibleNodeData(ui::AXNodeData* node_data) { 629 void TabbedPane::GetAccessibleNodeData(ui::AXNodeData* node_data) {
630 node_data->role = ui::AX_ROLE_TAB_LIST; 630 node_data->role = ui::AX_ROLE_TAB_LIST;
631 } 631 }
632 632
633 } // namespace views 633 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698