Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h |
| diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h |
| index 634342990b91c67eb77ff92d87c47f864ab44986..76cbc0f5d728ef606518fc98374ba019962f3828 100644 |
| --- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h |
| +++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h |
| @@ -47,14 +47,6 @@ class Node; |
| class SpellingMarkerList; |
| class TextMatchMarkerList; |
| -class MarkerRemoverPredicate final { |
| - public: |
| - explicit MarkerRemoverPredicate(const Vector<String>& words); |
| - bool operator()(const DocumentMarker&, const Text&) const; |
| - |
| - Vector<String> m_words; |
| -}; |
| - |
| class CORE_EXPORT DocumentMarkerController final |
| : public GarbageCollected<DocumentMarkerController>, |
| public SynchronousMutationObserver { |
| @@ -66,16 +58,21 @@ class CORE_EXPORT DocumentMarkerController final |
| void clear(); |
| void addMarker(Node*, DocumentMarker*); |
| - void addMarker(const Position& start, |
| - const Position& end, |
| - DocumentMarker::MarkerType, |
| - const String& description = emptyString); |
| - void addTextMatchMarker(const EphemeralRange&, bool activeMatch); |
| + |
| void addCompositionMarker(const Position& start, |
| const Position& end, |
| Color underlineColor, |
| bool thick, |
| Color backgroundColor); |
| + void addGrammarMarker(const Position& start, |
|
yosin_UTC9
2017/03/21 05:46:55
Could you introduce them one-by-one to make patch
|
| + const Position& end, |
| + const String& description = emptyString); |
| + void addSpellingMarker(const Position& start, |
| + const Position& end, |
| + const String& description = emptyString); |
| + void addTextMatchMarker(const Position& start, |
|
yosin_UTC9
2017/03/21 05:46:55
We prefer to use |EPhemeralRange| instead of passi
|
| + const Position& end, |
| + bool activeMatch); |
| void copyMarkers(Node* srcNode, |
| unsigned startOffset, |
| @@ -108,14 +105,17 @@ class CORE_EXPORT DocumentMarkerController final |
| void removeMarkers( |
| Node*, |
| DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); |
| - void removeMarkers(const MarkerRemoverPredicate& shouldRemoveMarker); |
| + void removeSpellingMarkersForWords(const Vector<String>& words); |
| void repaintMarkers( |
| DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); |
| // Returns true if markers within a range are found. |
| - bool setMarkersActive(const EphemeralRange&, bool); |
| + bool setTextMatchMarkersActive(const EphemeralRange&, bool); |
| // Returns true if markers within a range defined by a node, |startOffset| and |
| // |endOffset| are found. |
| - bool setMarkersActive(Node*, unsigned startOffset, unsigned endOffset, bool); |
| + bool setTextMatchMarkersActive(Node*, |
| + unsigned startOffset, |
| + unsigned endOffset, |
| + bool); |
| bool hasMarkers(Node*) const; |
| DocumentMarkerVector markersFor( |
| @@ -124,10 +124,9 @@ class CORE_EXPORT DocumentMarkerController final |
| DocumentMarkerVector markersInRange(const EphemeralRange&, |
| DocumentMarker::MarkerTypes); |
| DocumentMarkerVector markers(); |
| - Vector<IntRect> renderedRectsForMarkers(DocumentMarker::MarkerType); |
| - |
| - void invalidateRectsForAllMarkers(); |
| - void invalidateRectsForMarkersInNode(Node&); |
| + Vector<IntRect> renderedRectsForTextMatchMarkers(); |
| + void invalidateRectsForAllTextMatchMarkers(); |
| + void invalidateRectsForTextMatchMarkersInNode(Node&); |
| DECLARE_TRACE(); |
| @@ -189,6 +188,10 @@ class CORE_EXPORT DocumentMarkerController final |
| } |
| } |
| + void addGrammarOrSpellingMarker(const Position& start, |
| + const Position& end, |
| + DocumentMarker::MarkerType, |
| + const String& description); |
| HeapVector<Member<DocumentMarkerList>> getMarkerListsForNode( |
| Node*, |
| DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); |