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

Side by Side Diff: ui/views/accessibility/ax_view_obj_wrapper.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
« no previous file with comments | « ui/accessibility/tree_generator.cc ('k') | ui/views/accessibility/ax_window_obj_wrapper.cc » ('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 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 "ui/views/accessibility/ax_view_obj_wrapper.h" 5 #include "ui/views/accessibility/ax_view_obj_wrapper.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "ui/accessibility/ax_action_data.h" 8 #include "ui/accessibility/ax_action_data.h"
9 #include "ui/accessibility/ax_node_data.h" 9 #include "ui/accessibility/ax_node_data.h"
10 #include "ui/events/event_utils.h" 10 #include "ui/events/event_utils.h"
(...skipping 28 matching lines...) Expand all
39 if (!view_->child_at(i)->visible()) 39 if (!view_->child_at(i)->visible())
40 continue; 40 continue;
41 41
42 AXAuraObjWrapper* child = 42 AXAuraObjWrapper* child =
43 AXAuraObjCache::GetInstance()->GetOrCreate(view_->child_at(i)); 43 AXAuraObjCache::GetInstance()->GetOrCreate(view_->child_at(i));
44 out_children->push_back(child); 44 out_children->push_back(child);
45 } 45 }
46 } 46 }
47 47
48 void AXViewObjWrapper::Serialize(ui::AXNodeData* out_node_data) { 48 void AXViewObjWrapper::Serialize(ui::AXNodeData* out_node_data) {
49 out_node_data->state = 0;
sky 2017/05/08 15:56:27 How come the new code doesn't need a ClearState()
Patti Lor 2017/05/09 06:03:40 The current AXNodeData class initialises its |stat
50 view_->GetAccessibleNodeData(out_node_data); 49 view_->GetAccessibleNodeData(out_node_data);
51 50
52 out_node_data->id = GetID(); 51 out_node_data->id = GetID();
53 52
54 if (view_->IsAccessibilityFocusable()) 53 if (view_->IsAccessibilityFocusable())
55 out_node_data->state |= 1 << ui::AX_STATE_FOCUSABLE; 54 out_node_data->AddState(ui::AX_STATE_FOCUSABLE);
56 if (!view_->visible()) 55 if (!view_->visible())
57 out_node_data->state |= 1 << ui::AX_STATE_INVISIBLE; 56 out_node_data->AddState(ui::AX_STATE_INVISIBLE);
58 57
59 out_node_data->location = gfx::RectF(view_->GetBoundsInScreen()); 58 out_node_data->location = gfx::RectF(view_->GetBoundsInScreen());
60 } 59 }
61 60
62 int32_t AXViewObjWrapper::GetID() { 61 int32_t AXViewObjWrapper::GetID() {
63 return AXAuraObjCache::GetInstance()->GetID(view_); 62 return AXAuraObjCache::GetInstance()->GetID(view_);
64 } 63 }
65 64
66 bool AXViewObjWrapper::HandleAccessibleAction(const ui::AXActionData& action) { 65 bool AXViewObjWrapper::HandleAccessibleAction(const ui::AXActionData& action) {
67 return view_->HandleAccessibleAction(action); 66 return view_->HandleAccessibleAction(action);
68 } 67 }
69 68
70 } // namespace views 69 } // namespace views
OLDNEW
« no previous file with comments | « ui/accessibility/tree_generator.cc ('k') | ui/views/accessibility/ax_window_obj_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698