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

Side by Side Diff: ui/accessibility/platform/test_ax_node_wrapper.cc

Issue 2877313003: Fixed IAccessible::accNavigate for NAVDIR_NEXT and NAVDIR_PREVIOUS when start object was a simple c… (Closed)
Patch Set: Fixed comment. 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/platform/ax_platform_node_win_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "base/containers/hash_tables.h" 5 #include "base/containers/hash_tables.h"
6 #include "ui/accessibility/ax_action_data.h" 6 #include "ui/accessibility/ax_action_data.h"
7 #include "ui/accessibility/platform/test_ax_node_wrapper.h" 7 #include "ui/accessibility/platform/test_ax_node_wrapper.h"
8 #include "ui/gfx/geometry/rect_conversions.h" 8 #include "ui/gfx/geometry/rect_conversions.h"
9 9
10 namespace ui { 10 namespace ui {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 bool root_changed, 42 bool root_changed,
43 const std::vector<Change>& changes) override {} 43 const std::vector<Change>& changes) override {}
44 }; 44 };
45 45
46 TestAXTreeDelegate g_ax_tree_delegate; 46 TestAXTreeDelegate g_ax_tree_delegate;
47 47
48 } // namespace 48 } // namespace
49 49
50 // static 50 // static
51 TestAXNodeWrapper* TestAXNodeWrapper::GetOrCreate(AXTree* tree, AXNode* node) { 51 TestAXNodeWrapper* TestAXNodeWrapper::GetOrCreate(AXTree* tree, AXNode* node) {
52 // Just return NULL if |node| is NULL; this makes test code simpler because 52 if (!tree || !node)
53 // now we don't have to null-check AXNode* every time we call GetOrCreate.
54 if (!node)
55 return nullptr; 53 return nullptr;
56 54
57 tree->SetDelegate(&g_ax_tree_delegate); 55 tree->SetDelegate(&g_ax_tree_delegate);
58 auto iter = g_node_to_wrapper_map.find(node); 56 auto iter = g_node_to_wrapper_map.find(node);
59 if (iter != g_node_to_wrapper_map.end()) 57 if (iter != g_node_to_wrapper_map.end())
60 return iter->second; 58 return iter->second;
61 TestAXNodeWrapper* wrapper = new TestAXNodeWrapper(tree, node); 59 TestAXNodeWrapper* wrapper = new TestAXNodeWrapper(tree, node);
62 g_node_to_wrapper_map[node] = wrapper; 60 g_node_to_wrapper_map[node] = wrapper;
63 return wrapper; 61 return wrapper;
64 } 62 }
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 return true; 123 return true;
126 } 124 }
127 125
128 TestAXNodeWrapper::TestAXNodeWrapper(AXTree* tree, AXNode* node) 126 TestAXNodeWrapper::TestAXNodeWrapper(AXTree* tree, AXNode* node)
129 : tree_(tree), 127 : tree_(tree),
130 node_(node), 128 node_(node),
131 platform_node_(AXPlatformNode::Create(this)) { 129 platform_node_(AXPlatformNode::Create(this)) {
132 } 130 }
133 131
134 } // namespace ui 132 } // namespace ui
OLDNEW
« no previous file with comments | « ui/accessibility/platform/ax_platform_node_win_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698