Chromium Code Reviews| 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 EditingMarkerList_h | |
| 6 #define EditingMarkerList_h | |
| 7 | |
| 8 #include "core/editing/markers/DocumentMarkerList.h" | |
| 9 | |
| 10 namespace blink { | |
| 11 | |
| 12 class DocumentMarker; | |
| 13 | |
| 14 class EditingMarkerList : public DocumentMarkerList { | |
| 15 WTF_MAKE_NONCOPYABLE(EditingMarkerList); | |
| 16 | |
| 17 public: | |
| 18 explicit EditingMarkerList(DocumentMarkerController*); | |
| 19 | |
| 20 // DocumentMarkerList implementations | |
| 21 void clear() final; | |
| 22 | |
| 23 bool copyMarkers(unsigned startOffset, | |
| 24 int length, | |
| 25 Node* dstNode, | |
| 26 int delta) const final; | |
| 27 void removeMarkers(unsigned startOffset, | |
| 28 int length, | |
| 29 bool shouldRemovePartiallyOverlappingMarkers, | |
| 30 bool* didRemoveMarker) final; | |
| 31 bool shiftMarkers(unsigned offset, | |
| 32 unsigned oldLength, | |
| 33 unsigned newLength) final; | |
| 34 | |
| 35 // EditingMarkerList-specific | |
| 36 virtual void insert(DocumentMarker*); | |
| 37 | |
| 38 DECLARE_VIRTUAL_TRACE(); | |
| 39 | |
| 40 protected: | |
| 41 void sortMarkerList(); | |
| 42 | |
| 43 bool m_markersAreSorted; | |
| 44 | |
| 45 private: | |
| 46 static bool compareByStart(const Member<DocumentMarker>& lhv, | |
|
Xiaocheng
2017/03/21 03:59:44
This function should be hidden in an anonymous nam
| |
| 47 const Member<DocumentMarker>& rhv); | |
| 48 }; | |
| 49 | |
| 50 } // namespace blink | |
| 51 | |
| 52 #endif // EditingMarkerList_h | |
| OLD | NEW |