| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/accessibility/ax_node.h" | 5 #include "ui/accessibility/ax_node.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "ui/accessibility/ax_enums.h" | 10 #include "ui/accessibility/ax_enums.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 data().role == AX_ROLE_LINE_BREAK || | 25 data().role == AX_ROLE_LINE_BREAK || |
| 26 data().role == AX_ROLE_INLINE_TEXT_BOX; | 26 data().role == AX_ROLE_INLINE_TEXT_BOX; |
| 27 } | 27 } |
| 28 | 28 |
| 29 void AXNode::SetData(const AXNodeData& src) { | 29 void AXNode::SetData(const AXNodeData& src) { |
| 30 data_ = src; | 30 data_ = src; |
| 31 } | 31 } |
| 32 | 32 |
| 33 void AXNode::SetLocation(int offset_container_id, | 33 void AXNode::SetLocation(int offset_container_id, |
| 34 const gfx::RectF& location, | 34 const gfx::RectF& location, |
| 35 gfx::Transform* transform) { | 35 gfx::Transform* transform, |
| 36 bool is_fixed_positioned) { |
| 36 data_.offset_container_id = offset_container_id; | 37 data_.offset_container_id = offset_container_id; |
| 37 data_.location = location; | 38 data_.location = location; |
| 38 if (transform) | 39 if (transform) |
| 39 data_.transform.reset(new gfx::Transform(*transform)); | 40 data_.transform.reset(new gfx::Transform(*transform)); |
| 40 else | 41 else |
| 41 data_.transform.reset(nullptr); | 42 data_.transform.reset(nullptr); |
| 43 data_.is_fixed_positioned = is_fixed_positioned; |
| 42 } | 44 } |
| 43 | 45 |
| 44 void AXNode::SetIndexInParent(int index_in_parent) { | 46 void AXNode::SetIndexInParent(int index_in_parent) { |
| 45 index_in_parent_ = index_in_parent; | 47 index_in_parent_ = index_in_parent; |
| 46 } | 48 } |
| 47 | 49 |
| 48 void AXNode::SwapChildren(std::vector<AXNode*>& children) { | 50 void AXNode::SwapChildren(std::vector<AXNode*>& children) { |
| 49 children.swap(children_); | 51 children.swap(children_); |
| 50 } | 52 } |
| 51 | 53 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 if (line_offsets->empty() || line_offsets->back() != *start_offset) | 94 if (line_offsets->empty() || line_offsets->back() != *start_offset) |
| 93 line_offsets->push_back(*start_offset); | 95 line_offsets->push_back(*start_offset); |
| 94 } | 96 } |
| 95 | 97 |
| 96 base::string16 text = child->data().GetString16Attribute(ui::AX_ATTR_NAME); | 98 base::string16 text = child->data().GetString16Attribute(ui::AX_ATTR_NAME); |
| 97 *start_offset += static_cast<int>(text.length()); | 99 *start_offset += static_cast<int>(text.length()); |
| 98 } | 100 } |
| 99 } | 101 } |
| 100 | 102 |
| 101 } // namespace ui | 103 } // namespace ui |
| OLD | NEW |