OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights |
7 * reserved. | 7 * reserved. |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
10 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 class MarkerRemoverPredicate final { | 47 class MarkerRemoverPredicate final { |
48 public: | 48 public: |
49 explicit MarkerRemoverPredicate(const Vector<String>& words); | 49 explicit MarkerRemoverPredicate(const Vector<String>& words); |
50 bool operator()(const DocumentMarker&, const Text&) const; | 50 bool operator()(const DocumentMarker&, const Text&) const; |
51 | 51 |
52 private: | 52 private: |
53 Vector<String> words_; | 53 Vector<String> words_; |
54 }; | 54 }; |
55 | 55 |
56 class DocumentMarkerListEditor { | |
57 public: | |
58 using MarkerList = HeapVector<Member<RenderedDocumentMarker>>; | |
59 | |
60 static void AddMarker(MarkerList*, const DocumentMarker*); | |
61 | |
62 // Returns true if a marker was moved, false otherwise. | |
63 static bool MoveMarkers(MarkerList* src_list, | |
64 int length, | |
65 MarkerList* dst_list); | |
66 | |
67 // Returns true if a marker was removed, false otherwise. | |
68 static bool RemoveMarkers(MarkerList*, unsigned start_offset, int length); | |
69 | |
70 // Returns true if a marker was shifted or removed, false otherwise. | |
71 static bool ShiftMarkers(MarkerList*, | |
72 unsigned offset, | |
73 unsigned old_length, | |
74 unsigned new_length); | |
75 | |
76 private: | |
77 static void MergeOverlapping(MarkerList*, RenderedDocumentMarker* to_insert); | |
78 }; | |
79 | |
80 class CORE_EXPORT DocumentMarkerController final | 56 class CORE_EXPORT DocumentMarkerController final |
81 : public GarbageCollected<DocumentMarkerController>, | 57 : public GarbageCollected<DocumentMarkerController>, |
82 public SynchronousMutationObserver { | 58 public SynchronousMutationObserver { |
83 WTF_MAKE_NONCOPYABLE(DocumentMarkerController); | 59 WTF_MAKE_NONCOPYABLE(DocumentMarkerController); |
84 USING_GARBAGE_COLLECTED_MIXIN(DocumentMarkerController); | 60 USING_GARBAGE_COLLECTED_MIXIN(DocumentMarkerController); |
85 | 61 |
86 public: | 62 public: |
87 explicit DocumentMarkerController(Document&); | 63 explicit DocumentMarkerController(Document&); |
88 | 64 |
89 void Clear(); | 65 void Clear(); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 const Member<const Document> document_; | 146 const Member<const Document> document_; |
171 }; | 147 }; |
172 | 148 |
173 } // namespace blink | 149 } // namespace blink |
174 | 150 |
175 #ifndef NDEBUG | 151 #ifndef NDEBUG |
176 void showDocumentMarkers(const blink::DocumentMarkerController*); | 152 void showDocumentMarkers(const blink::DocumentMarkerController*); |
177 #endif | 153 #endif |
178 | 154 |
179 #endif // DocumentMarkerController_h | 155 #endif // DocumentMarkerController_h |
OLD | NEW |