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

Unified Diff: content/public/common/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: Refactored AXTreeImpl::UpdateNode 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
Index: content/public/common/ax_node_data.cc
diff --git a/content/public/common/ax_node_data.cc b/content/public/common/ax_node_data.cc
new file mode 100644
index 0000000000000000000000000000000000000000..3a4a615f148ee61cf679f3f8f3e10f2810be517c
--- /dev/null
+++ b/content/public/common/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 "content/public/common/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 content {
+
+AXNodeData::AXNodeData()
+ : id(-1),
+ role(WebKit::WebAXRoleUnknown),
+ 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 content

Powered by Google App Engine
This is Rietveld 408576698