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