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

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

Issue 2765133002: [WIP] Add DocumentMarkerController::addGrammarMarker() and addSpellingMarker() (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 : public GarbageCollected<DocumentMarkerController>, 47 : public GarbageCollected<DocumentMarkerController>,
48 public SynchronousMutationObserver { 48 public SynchronousMutationObserver {
49 WTF_MAKE_NONCOPYABLE(DocumentMarkerController); 49 WTF_MAKE_NONCOPYABLE(DocumentMarkerController);
50 USING_GARBAGE_COLLECTED_MIXIN(DocumentMarkerController); 50 USING_GARBAGE_COLLECTED_MIXIN(DocumentMarkerController);
51 51
52 public: 52 public:
53 explicit DocumentMarkerController(Document&); 53 explicit DocumentMarkerController(Document&);
54 54
55 void clear(); 55 void clear();
56 void addMarker(Node*, DocumentMarker*); 56 void addMarker(Node*, DocumentMarker*);
57 void addMarker(const Position& start, 57
58 const Position& end, 58 void addSpellingMarker(const Position& start,
59 DocumentMarker::MarkerType, 59 const Position& end,
60 const String& description = emptyString); 60 const String& description = emptyString);
61 void addGrammarMarker(const Position& start,
62 const Position& end,
63 const String& description = emptyString);
61 void addTextMatchMarker(const EphemeralRange&, bool activeMatch); 64 void addTextMatchMarker(const EphemeralRange&, bool activeMatch);
62 void addCompositionMarker(const Position& start, 65 void addCompositionMarker(const Position& start,
63 const Position& end, 66 const Position& end,
64 Color underlineColor, 67 Color underlineColor,
65 bool thick, 68 bool thick,
66 Color backgroundColor); 69 Color backgroundColor);
67 70
68 void copyMarkers(Node* srcNode, 71 void copyMarkers(Node* srcNode,
69 unsigned startOffset, 72 unsigned startOffset,
70 int length, 73 int length,
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 131
129 // SynchronousMutationObserver 132 // SynchronousMutationObserver
130 void didUpdateCharacterData(CharacterData*, 133 void didUpdateCharacterData(CharacterData*,
131 unsigned offset, 134 unsigned offset,
132 unsigned oldLength, 135 unsigned oldLength,
133 unsigned newLength) final; 136 unsigned newLength) final;
134 137
135 private: 138 private:
136 using MarkerMap = HeapHashMap<WeakMember<Node>, Member<DocumentMarkerList>>; 139 using MarkerMap = HeapHashMap<WeakMember<Node>, Member<DocumentMarkerList>>;
137 140
141 void addGrammarOrSpellingMarker(const Position& start,
142 const Position& end,
143 DocumentMarker::MarkerType,
144 const String& description);
138 DocumentMarkerList* createMarkerListOfType(DocumentMarker::MarkerType); 145 DocumentMarkerList* createMarkerListOfType(DocumentMarker::MarkerType);
139 HeapVector<Member<DocumentMarkerList>> getMarkerListsForNode( 146 HeapVector<Member<DocumentMarkerList>> getMarkerListsForNode(
140 Node*, 147 Node*,
141 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); 148 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers());
142 MarkerMap& markerMapForType(DocumentMarker::MarkerType); 149 MarkerMap& markerMapForType(DocumentMarker::MarkerType);
143 const MarkerMap& markerMapForType(DocumentMarker::MarkerType) const; 150 const MarkerMap& markerMapForType(DocumentMarker::MarkerType) const;
144 void removeMarkers(TextIterator&, 151 void removeMarkers(TextIterator&,
145 DocumentMarker::MarkerTypes, 152 DocumentMarker::MarkerTypes,
146 RemovePartiallyOverlappingMarkerOrNot); 153 RemovePartiallyOverlappingMarkerOrNot);
147 154
148 MarkerMap m_spelling; 155 MarkerMap m_spelling;
149 MarkerMap m_grammar; 156 MarkerMap m_grammar;
150 MarkerMap m_textMatches; 157 MarkerMap m_textMatches;
151 MarkerMap m_compositions; 158 MarkerMap m_compositions;
152 159
153 const Member<const Document> m_document; 160 const Member<const Document> m_document;
154 }; 161 };
155 162
156 } // namespace blink 163 } // namespace blink
157 164
158 #ifndef NDEBUG 165 #ifndef NDEBUG
159 void showDocumentMarkers(const blink::DocumentMarkerController*); 166 void showDocumentMarkers(const blink::DocumentMarkerController*);
160 #endif 167 #endif
161 168
162 #endif // DocumentMarkerController_h 169 #endif // DocumentMarkerController_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698