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 GenericDocumentMarkerListImpl_h |
| 6 #define GenericDocumentMarkerListImpl_h |
| 7 |
| 8 #include "core/editing/markers/DocumentMarkerList.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 class RenderedDocumentMarker; |
| 13 |
| 14 // Temporary implementation of DocumentMarkerList that can handle |
| 15 // DocumentMarkers of all MarkerTypes. This will be removed once we have |
| 16 // specialized implementations for every MarkerType. |
| 17 class GenericDocumentMarkerListImpl final : public DocumentMarkerList { |
| 18 public: |
| 19 GenericDocumentMarkerListImpl() = default; |
| 20 |
| 21 // DocumentMarkerList implementations |
| 22 bool IsEmpty() const final; |
| 23 |
| 24 void Add(DocumentMarker*) final; |
| 25 void Clear() final; |
| 26 |
| 27 const HeapVector<Member<RenderedDocumentMarker>>& GetMarkers() const final; |
| 28 |
| 29 bool MoveMarkers(int length, DocumentMarkerList* dst_list) final; |
| 30 bool RemoveMarkers(unsigned start_offset, int length) final; |
| 31 bool RemoveMarkersUnderWords(const String& node_text, |
| 32 const Vector<String>& words) final; |
| 33 bool ShiftMarkers(unsigned offset, |
| 34 unsigned old_length, |
| 35 unsigned new_length) final; |
| 36 |
| 37 DECLARE_TRACE(); |
| 38 |
| 39 private: |
| 40 HeapVector<Member<RenderedDocumentMarker>> markers_; |
| 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(GenericDocumentMarkerListImpl); |
| 43 }; |
| 44 |
| 45 } // namespace blink |
| 46 |
| 47 #endif // GenericDocumentMarkerListImpl_h |
OLD | NEW |