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

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

Issue 2833753004: [DMC #1.915] Refactor DocumentMarkerController::RemoveMarkers(const MarkerRemoverPredicate&) (Closed)
Patch Set: Use const 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
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 24 matching lines...) Expand all
35 #include "core/editing/markers/DocumentMarker.h" 35 #include "core/editing/markers/DocumentMarker.h"
36 #include "platform/geometry/IntRect.h" 36 #include "platform/geometry/IntRect.h"
37 #include "platform/heap/Handle.h" 37 #include "platform/heap/Handle.h"
38 #include "platform/wtf/HashMap.h" 38 #include "platform/wtf/HashMap.h"
39 #include "platform/wtf/Vector.h" 39 #include "platform/wtf/Vector.h"
40 40
41 namespace blink { 41 namespace blink {
42 42
43 class Node; 43 class Node;
44 class RenderedDocumentMarker; 44 class RenderedDocumentMarker;
45 class Text;
46
47 class MarkerRemoverPredicate final {
48 public:
49 explicit MarkerRemoverPredicate(const Vector<String>& words);
50 bool operator()(const DocumentMarker&, const Text&) const;
51
52 private:
53 Vector<String> words_;
54 };
55 45
56 class CORE_EXPORT DocumentMarkerController final 46 class CORE_EXPORT DocumentMarkerController final
57 : public GarbageCollected<DocumentMarkerController>, 47 : public GarbageCollected<DocumentMarkerController>,
58 public SynchronousMutationObserver { 48 public SynchronousMutationObserver {
59 WTF_MAKE_NONCOPYABLE(DocumentMarkerController); 49 WTF_MAKE_NONCOPYABLE(DocumentMarkerController);
60 USING_GARBAGE_COLLECTED_MIXIN(DocumentMarkerController); 50 USING_GARBAGE_COLLECTED_MIXIN(DocumentMarkerController);
61 51
62 public: 52 public:
63 explicit DocumentMarkerController(Document&); 53 explicit DocumentMarkerController(Document&);
64 54
(...skipping 18 matching lines...) Expand all
83 void RemoveMarkers( 73 void RemoveMarkers(
84 Node*, 74 Node*,
85 unsigned start_offset, 75 unsigned start_offset,
86 int length, 76 int length,
87 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); 77 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers());
88 void RemoveMarkers( 78 void RemoveMarkers(
89 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); 79 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers());
90 void RemoveMarkers( 80 void RemoveMarkers(
91 Node*, 81 Node*,
92 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); 82 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers());
93 void RemoveMarkers(const MarkerRemoverPredicate& should_remove_marker); 83 void RemoveSpellingMarkersUnderWords(const Vector<String>& words);
94 void RepaintMarkers( 84 void RepaintMarkers(
95 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); 85 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers());
96 // Returns true if markers within a range are found. 86 // Returns true if markers within a range are found.
97 bool SetMarkersActive(const EphemeralRange&, bool); 87 bool SetMarkersActive(const EphemeralRange&, bool);
98 // Returns true if markers within a range defined by a node, |startOffset| and 88 // Returns true if markers within a range defined by a node, |startOffset| and
99 // |endOffset| are found. 89 // |endOffset| are found.
100 bool SetMarkersActive(Node*, 90 bool SetMarkersActive(Node*,
101 unsigned start_offset, 91 unsigned start_offset,
102 unsigned end_offset, 92 unsigned end_offset,
103 bool); 93 bool);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 const Member<const Document> document_; 136 const Member<const Document> document_;
147 }; 137 };
148 138
149 } // namespace blink 139 } // namespace blink
150 140
151 #ifndef NDEBUG 141 #ifndef NDEBUG
152 void showDocumentMarkers(const blink::DocumentMarkerController*); 142 void showDocumentMarkers(const blink::DocumentMarkerController*);
153 #endif 143 #endif
154 144
155 #endif // DocumentMarkerController_h 145 #endif // DocumentMarkerController_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698