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

Unified Diff: ui/accessibility/ax_node_data.cc

Issue 67283004: First step to move common accessibility code out of content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Git rid of AX_EXPORT from templatized function Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/accessibility/ax_node_data.h ('k') | ui/accessibility/ax_serializable_tree.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/accessibility/ax_node_data.cc
diff --git a/ui/accessibility/ax_node_data.cc b/ui/accessibility/ax_node_data.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9a4e1a75858cf0681fcfb0fab3e2047ec28436dc
--- /dev/null
+++ b/ui/accessibility/ax_node_data.cc
@@ -0,0 +1,61 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/accessibility/ax_node_data.h"
+
+#include <set>
+
+#include "base/containers/hash_tables.h"
+#include "base/strings/string_number_conversions.h"
+#include "base/strings/string_util.h"
+#include "base/strings/utf_string_conversions.h"
+
+using base::DoubleToString;
+using base::IntToString;
+
+namespace ui {
+
+AXNodeData::AXNodeData()
+ : id(-1),
+ role(AX_ROLE_UNKNOWN),
+ state(-1) {
+}
+
+AXNodeData::~AXNodeData() {
+}
+
+void AXNodeData::AddStringAttribute(
+ StringAttribute attribute, const std::string& value) {
+ string_attributes.push_back(std::make_pair(attribute, value));
+}
+
+void AXNodeData::AddIntAttribute(
+ IntAttribute attribute, int value) {
+ int_attributes.push_back(std::make_pair(attribute, value));
+}
+
+void AXNodeData::AddFloatAttribute(
+ FloatAttribute attribute, float value) {
+ float_attributes.push_back(std::make_pair(attribute, value));
+}
+
+void AXNodeData::AddBoolAttribute(
+ BoolAttribute attribute, bool value) {
+ bool_attributes.push_back(std::make_pair(attribute, value));
+}
+
+void AXNodeData::AddIntListAttribute(
+ IntListAttribute attribute, const std::vector<int32>& value) {
+ intlist_attributes.push_back(std::make_pair(attribute, value));
+}
+
+void AXNodeData::SetName(std::string name) {
+ string_attributes.push_back(std::make_pair(ATTR_NAME, name));
+}
+
+void AXNodeData::SetValue(std::string value) {
+ string_attributes.push_back(std::make_pair(ATTR_VALUE, value));
+}
+
+} // namespace ui
« no previous file with comments | « ui/accessibility/ax_node_data.h ('k') | ui/accessibility/ax_serializable_tree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698