| OLD | NEW | 
|---|
| 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 "ui/accessibility/ax_tree_data.h" | 5 #include "ui/accessibility/ax_tree_data.h" | 
| 6 | 6 | 
| 7 #include <set> | 7 #include <set> | 
| 8 | 8 | 
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" | 
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" | 
| (...skipping 28 matching lines...) Expand all  Loading... | 
| 39 std::string AXTreeData::ToString() const { | 39 std::string AXTreeData::ToString() const { | 
| 40   std::string result; | 40   std::string result; | 
| 41 | 41 | 
| 42   if (tree_id != -1) | 42   if (tree_id != -1) | 
| 43     result += " tree_id=" + IntToString(tree_id); | 43     result += " tree_id=" + IntToString(tree_id); | 
| 44   if (parent_tree_id != -1) | 44   if (parent_tree_id != -1) | 
| 45     result += " parent_tree_id=" + IntToString(parent_tree_id); | 45     result += " parent_tree_id=" + IntToString(parent_tree_id); | 
| 46   if (focused_tree_id != -1) | 46   if (focused_tree_id != -1) | 
| 47     result += " focused_tree_id=" + IntToString(focused_tree_id); | 47     result += " focused_tree_id=" + IntToString(focused_tree_id); | 
| 48 | 48 | 
|  | 49   if (!doctype.empty()) | 
|  | 50     result += " doctype=" + doctype; | 
|  | 51   if (loaded) | 
|  | 52     result += " loaded=true"; | 
|  | 53   if (loading_progress != 0.0) | 
|  | 54     result += " loading_progress=" + DoubleToString(loading_progress); | 
|  | 55   if (!mimetype.empty()) | 
|  | 56     result += " mimetype=" + mimetype; | 
| 49   if (!url.empty()) | 57   if (!url.empty()) | 
| 50     result += " url=" + url; | 58     result += " url=" + url; | 
| 51   if (!title.empty()) | 59   if (!title.empty()) | 
| 52     result += " title=" + title; | 60     result += " title=" + title; | 
| 53   if (!mimetype.empty()) |  | 
| 54     result += " mimetype=" + mimetype; |  | 
| 55   if (!doctype.empty()) |  | 
| 56     result += " doctype=" + doctype; |  | 
| 57 |  | 
| 58   if (loaded) |  | 
| 59     result += " loaded=true"; |  | 
| 60   if (loading_progress != 0.0) |  | 
| 61     result += " loading_progress=" + DoubleToString(loading_progress); |  | 
| 62 | 61 | 
| 63   if (focus_id != -1) | 62   if (focus_id != -1) | 
| 64     result += " focus_id=" + IntToString(focus_id); | 63     result += " focus_id=" + IntToString(focus_id); | 
| 65 | 64 | 
| 66   if (sel_anchor_object_id != -1) { | 65   if (sel_anchor_object_id != -1) { | 
| 67     result += " sel_anchor_object_id=" + IntToString(sel_anchor_object_id); | 66     result += " sel_anchor_object_id=" + IntToString(sel_anchor_object_id); | 
| 68     result += " sel_anchor_offset=" + IntToString(sel_anchor_offset); | 67     result += " sel_anchor_offset=" + IntToString(sel_anchor_offset); | 
| 69   } | 68   } | 
| 70   if (sel_focus_object_id != -1) { | 69   if (sel_focus_object_id != -1) { | 
| 71     result += " sel_focus_object_id=" + IntToString(sel_focus_object_id); | 70     result += " sel_focus_object_id=" + IntToString(sel_focus_object_id); | 
| 72     result += " sel_focus_offset=" + IntToString(sel_focus_offset); | 71     result += " sel_focus_offset=" + IntToString(sel_focus_offset); | 
| 73   } | 72   } | 
| 74 | 73 | 
| 75   return result; | 74   return result; | 
| 76 } | 75 } | 
| 77 | 76 | 
| 78 bool operator==(const AXTreeData& lhs, const AXTreeData& rhs) { | 77 bool operator==(const AXTreeData& lhs, const AXTreeData& rhs) { | 
| 79   return (lhs.tree_id == rhs.tree_id && | 78   return (lhs.tree_id == rhs.tree_id && | 
| 80           lhs.parent_tree_id == rhs.parent_tree_id && | 79           lhs.parent_tree_id == rhs.parent_tree_id && | 
| 81           lhs.focused_tree_id == rhs.focused_tree_id && | 80           lhs.focused_tree_id == rhs.focused_tree_id && | 
| 82           lhs.url == rhs.url && | 81           lhs.doctype == rhs.doctype && lhs.loaded == rhs.loaded && | 
| 83           lhs.title == rhs.title && |  | 
| 84           lhs.mimetype == rhs.mimetype && |  | 
| 85           lhs.doctype == rhs.doctype && |  | 
| 86           lhs.loaded == rhs.loaded && |  | 
| 87           lhs.loading_progress == rhs.loading_progress && | 82           lhs.loading_progress == rhs.loading_progress && | 
| 88           lhs.focus_id == rhs.focus_id && | 83           lhs.mimetype == rhs.mimetype && lhs.title == rhs.title && | 
|  | 84           lhs.url == rhs.url && lhs.focus_id == rhs.focus_id && | 
| 89           lhs.sel_anchor_object_id == rhs.sel_anchor_object_id && | 85           lhs.sel_anchor_object_id == rhs.sel_anchor_object_id && | 
| 90           lhs.sel_anchor_offset == rhs.sel_anchor_offset && | 86           lhs.sel_anchor_offset == rhs.sel_anchor_offset && | 
| 91           lhs.sel_focus_object_id == rhs.sel_focus_object_id && | 87           lhs.sel_focus_object_id == rhs.sel_focus_object_id && | 
| 92           lhs.sel_focus_offset == rhs.sel_focus_offset); | 88           lhs.sel_focus_offset == rhs.sel_focus_offset); | 
| 93 } | 89 } | 
| 94 | 90 | 
| 95 bool operator!=(const AXTreeData& lhs, const AXTreeData& rhs) { | 91 bool operator!=(const AXTreeData& lhs, const AXTreeData& rhs) { | 
| 96   return !(lhs == rhs); | 92   return !(lhs == rhs); | 
| 97 } | 93 } | 
| 98 | 94 | 
| 99 }  // namespace ui | 95 }  // namespace ui | 
| OLD | NEW | 
|---|