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

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

Issue 2896703003: [DMC #11] Move some rendered rect method impls from DMC To TextMatchMarkerListImpl (Closed)
Patch Set: Rebase Created 3 years, 7 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
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 TextMatchMarkerListImpl_h 5 #ifndef TextMatchMarkerListImpl_h
6 #define TextMatchMarkerListImpl_h 6 #define TextMatchMarkerListImpl_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 IntRect;
13 class RenderedDocumentMarker;
14
12 // Implementation of DocumentMarkerList for TextMatch markers. 15 // Implementation of DocumentMarkerList for TextMatch markers.
13 // Markers are kept sorted by start offset, under the assumption that 16 // Markers are kept sorted by start offset, under the assumption that
14 // TextMatch markers are typically inserted in an order. 17 // TextMatch markers are typically inserted in an order.
15 class CORE_EXPORT TextMatchMarkerListImpl final : public DocumentMarkerList { 18 class CORE_EXPORT TextMatchMarkerListImpl final : public DocumentMarkerList {
16 public: 19 public:
17 TextMatchMarkerListImpl() = default; 20 TextMatchMarkerListImpl() = default;
18 21
19 // DocumentMarkerList implementations 22 // DocumentMarkerList implementations
20 DocumentMarker::MarkerType MarkerType() const final; 23 DocumentMarker::MarkerType MarkerType() const final;
21 24
22 bool IsEmpty() const final; 25 bool IsEmpty() const final;
23 26
24 void Add(DocumentMarker*) final; 27 void Add(DocumentMarker*) final;
25 void Clear() final; 28 void Clear() final;
26 29
27 const HeapVector<Member<DocumentMarker>>& GetMarkers() const final; 30 const HeapVector<Member<DocumentMarker>>& GetMarkers() const final;
28 31
29 bool MoveMarkers(int length, DocumentMarkerList* dst_list) final; 32 bool MoveMarkers(int length, DocumentMarkerList* dst_list) final;
30 bool RemoveMarkers(unsigned start_offset, int length) final; 33 bool RemoveMarkers(unsigned start_offset, int length) final;
31 bool ShiftMarkers(unsigned offset, 34 bool ShiftMarkers(unsigned offset,
32 unsigned old_length, 35 unsigned old_length,
33 unsigned new_length) final; 36 unsigned new_length) final;
34 DECLARE_VIRTUAL_TRACE(); 37 DECLARE_VIRTUAL_TRACE();
35 38
39 // TextMatchMarkerListImpl-specific
40 Vector<IntRect> RenderedRects(const Node&);
yosin_UTC9 2017/05/24 09:17:23 nit: s/;/ const;/
41
36 private: 42 private:
37 HeapVector<Member<DocumentMarker>> markers_; 43 HeapVector<Member<DocumentMarker>> markers_;
38 44
45 void UpdateMarkerRenderedRectIfNeeded(const Node&, RenderedDocumentMarker&);
46
39 DISALLOW_COPY_AND_ASSIGN(TextMatchMarkerListImpl); 47 DISALLOW_COPY_AND_ASSIGN(TextMatchMarkerListImpl);
40 }; 48 };
41 49
42 DEFINE_TYPE_CASTS(TextMatchMarkerListImpl, 50 DEFINE_TYPE_CASTS(TextMatchMarkerListImpl,
43 DocumentMarkerList, 51 DocumentMarkerList,
44 list, 52 list,
45 list->MarkerType() == DocumentMarker::kTextMatch, 53 list->MarkerType() == DocumentMarker::kTextMatch,
46 list.MarkerType() == DocumentMarker::kTextMatch); 54 list.MarkerType() == DocumentMarker::kTextMatch);
47 55
48 } // namespace blink 56 } // namespace blink
49 57
50 #endif // TextMatchMarkerListImpl_h 58 #endif // TextMatchMarkerListImpl_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698