OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 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 DocumentMarkerListEditor_h |
| 6 #define DocumentMarkerListEditor_h |
| 7 |
| 8 #include "platform/heap/Handle.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 class DocumentMarker; |
| 13 class RenderedDocumentMarker; |
| 14 |
| 15 class DocumentMarkerListEditor { |
| 16 public: |
| 17 using MarkerList = HeapVector<Member<RenderedDocumentMarker>>; |
| 18 |
| 19 static void AddMarker(MarkerList*, const DocumentMarker*); |
| 20 |
| 21 // Returns true if a marker was moved, false otherwise. |
| 22 static bool MoveMarkers(MarkerList* src_list, |
| 23 int length, |
| 24 MarkerList* dst_list); |
| 25 |
| 26 // Returns true if a marker was removed, false otherwise. |
| 27 static bool RemoveMarkers(MarkerList*, unsigned start_offset, int length); |
| 28 |
| 29 // Returns true if a marker was shifted or removed, false otherwise. |
| 30 static bool ShiftMarkers(MarkerList*, |
| 31 unsigned offset, |
| 32 unsigned old_length, |
| 33 unsigned new_length); |
| 34 |
| 35 private: |
| 36 static void MergeOverlapping(MarkerList*, RenderedDocumentMarker* to_insert); |
| 37 }; |
| 38 |
| 39 } // namespace blink |
| 40 |
| 41 #endif // DocumentMarkerListEditor_h |
OLD | NEW |