Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(450)

Side by Side Diff: third_party/WebKit/Source/core/editing/markers/TextMatchMarkerList.h

Issue 2805553003: DocumentMarkerList refactor as an interface (Closed)
Patch Set: Rebase on renaming patch, respond to comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 TextMatchMarkerList_h
6 #define TextMatchMarkerList_h
7
8 #include "core/editing/markers/DocumentMarkerList.h"
9
10 #include "core/editing/markers/TextMatchMarker.h"
11
12 namespace blink {
13
14 class CORE_EXPORT TextMatchMarkerList final : public DocumentMarkerList {
15 public:
16 TextMatchMarkerList();
17
18 DocumentMarker::MarkerType GetAllowedMarkerType() const final;
19
20 bool Empty() const final;
21 TextMatchMarker* At(size_t index) final;
22
23 void Add(DocumentMarker*) final;
24 void Clear() final;
25
26 void AppendMarkersToInputList(DocumentMarkerVector* list) const;
27
28 DidMoveMarkerOrNot MoveMarkers(int length, DocumentMarkerList* dst_list);
29
30 DidRemoveMarkerOrNot RemoveMarkers(unsigned start_offset, int length);
31
32 DidShiftMarkerOrNot ShiftMarkers(unsigned offset,
33 unsigned old_length,
34 unsigned new_length) final;
35
36 DECLARE_VIRTUAL_TRACE();
37
38 // TextMatchMarkerList-specific methods
39 void AppendRenderedRectsToInputList(const Node&,
40 Vector<IntRect>* result) const;
41 void InvalidateRects();
42 bool SetTextMatchMarkersActive(unsigned start_offset,
43 unsigned end_offset,
44 bool active);
45
46 private:
47 HeapVector<Member<DocumentMarker>> markers_;
48
49 DISALLOW_COPY_AND_ASSIGN(TextMatchMarkerList);
50 };
51
52 DEFINE_TYPE_CASTS(TextMatchMarkerList,
53 DocumentMarkerList,
54 list,
55 list->GetAllowedMarkerType() == DocumentMarker::kTextMatch,
56 list.GetAllowedMarkerType() == DocumentMarker::kTextMatch);
57
58 } // namespace blink
59
60 #endif // TextMatchMarkerList_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698