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