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

Side by Side Diff: ui/accessibility/ax_action_data.cc

Issue 2430473003: Revert of Create AXAction and AXActionData as a way to simplify accessibility actions (Closed)
Patch Set: Created 4 years, 2 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/ax_action_data.h ('k') | ui/accessibility/ax_enums.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/accessibility/ax_action_data.h"
6
7 #include <set>
8
9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h"
11 #include "base/strings/stringprintf.h"
12 #include "base/strings/utf_string_conversions.h"
13
14 using base::IntToString;
15
16 namespace ui {
17
18 AXActionData::AXActionData()
19 : action(AX_ACTION_NONE),
20 target_node_id(-1),
21 flags(0),
22 anchor_node_id(-1),
23 anchor_offset(-1),
24 focus_node_id(-1),
25 focus_offset(-1) {
26 }
27
28 AXActionData::AXActionData(const AXActionData& other) = default;
29
30 AXActionData::~AXActionData() {
31 }
32
33 // Note that this includes an initial space character if nonempty, but
34 // that works fine because this is normally printed by AXAction::ToString.
35 std::string AXActionData::ToString() const {
36 std::string result = ui::ToString(action);
37
38 if (target_node_id != -1)
39 result += " target_node_id=" + IntToString(target_node_id);
40
41 if (flags & (1 << ui::AX_ACTION_FLAGS_REQUEST_IMAGES))
42 result += " flag_request_images";
43
44 if (flags & (1 << ui::AX_ACTION_FLAGS_REQUEST_INLINE_TEXT_BOXES))
45 result += " flag_request_inline_text_boxes";
46
47 if (flags & (1 << ui::AX_ACTION_FLAGS_SET_SEQUENTIAL_FOCUS_NAVIGATION_POINT))
48 result += " flag_set_sequential_focus_navigation_point";
49
50 if (anchor_node_id != -1) {
51 result += " anchor_node_id=" + IntToString(anchor_node_id);
52 result += " anchor_offset=" + IntToString(anchor_offset);
53 }
54 if (focus_node_id != -1) {
55 result += " focus_node_id=" + IntToString(focus_node_id);
56 result += " focus_offset=" + IntToString(focus_offset);
57 }
58
59 return result;
60 }
61
62 } // namespace ui
OLDNEW
« no previous file with comments | « ui/accessibility/ax_action_data.h ('k') | ui/accessibility/ax_enums.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698