Abigail Klein | 508432f | 2022-12-15 17:23:21 | [diff] [blame] | 1 | // Copyright 2022 The Chromium Authors |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef UI_ACCESSIBILITY_AX_TREE_UPDATE_UTIL_H_ |
| 6 | #define UI_ACCESSIBILITY_AX_TREE_UPDATE_UTIL_H_ |
| 7 | |
| 8 | #include <vector> |
| 9 | |
| 10 | #include "ui/accessibility/ax_export.h" |
| 11 | #include "ui/accessibility/ax_tree_update_forward.h" |
| 12 | |
| 13 | namespace ui { |
| 14 | |
| 15 | AX_EXPORT bool AXTreeUpdatesCanBeMerged(const AXTreeUpdate& u1, |
| 16 | const AXTreeUpdate& u2); |
| 17 | |
| 18 | // If 2 or more tree updates can all be merged into others, |
| 19 | // process the whole set of tree updates, copying them to |dst|, |
| 20 | // and returning true. Otherwise, return false and |dst| |
| 21 | // is left unchanged. |
| 22 | // |
| 23 | // Merging tree updates helps minimize the overhead of calling |
| 24 | // Unserialize multiple times. |
Lauren Winston | 1fef47c | 2025-04-23 03:12:14 | [diff] [blame] | 25 | AX_EXPORT bool MergeAXTreeUpdates(std::vector<AXTreeUpdate>& src, |
Jacques Newman | a4149e85 | 2024-08-28 23:35:42 | [diff] [blame] | 26 | std::vector<AXTreeUpdate>* dst); |
Abigail Klein | 508432f | 2022-12-15 17:23:21 | [diff] [blame] | 27 | |
| 28 | } // namespace ui |
| 29 | |
| 30 | #endif // UI_ACCESSIBILITY_AX_TREE_UPDATE_UTIL_H_ |