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

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

Issue 2911723002: [DMC #24] Add SpellingMarker and GrammarMarker (subclasses of DocumentMarker) (Closed)
Patch Set: Add IsSpellCheckMarker() tests Created 3 years, 6 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 void DidUpdateCharacterData(CharacterData*, 107 void DidUpdateCharacterData(CharacterData*,
108 unsigned offset, 108 unsigned offset,
109 unsigned old_length, 109 unsigned old_length,
110 unsigned new_length) final; 110 unsigned new_length) final;
111 111
112 private: 112 private:
113 void AddMarkerInternal( 113 void AddMarkerInternal(
114 const EphemeralRange&, 114 const EphemeralRange&,
115 std::function<DocumentMarker*(int, int)> create_marker_from_offsets); 115 std::function<DocumentMarker*(int, int)> create_marker_from_offsets);
116 void AddMarkerToNode(Node*, DocumentMarker*); 116 void AddMarkerToNode(Node*, DocumentMarker*);
117 void AddSpellCheckMarker(const EphemeralRange&,
118 DocumentMarker::MarkerType,
119 const String& description = g_empty_string);
120 117
121 using MarkerLists = HeapVector<Member<DocumentMarkerList>, 118 using MarkerLists = HeapVector<Member<DocumentMarkerList>,
122 DocumentMarker::kMarkerTypeIndexesCount>; 119 DocumentMarker::kMarkerTypeIndexesCount>;
123 using MarkerMap = HeapHashMap<WeakMember<const Node>, Member<MarkerLists>>; 120 using MarkerMap = HeapHashMap<WeakMember<const Node>, Member<MarkerLists>>;
124 static Member<DocumentMarkerList>& ListForType(MarkerLists*, 121 static Member<DocumentMarkerList>& ListForType(MarkerLists*,
125 DocumentMarker::MarkerType); 122 DocumentMarker::MarkerType);
126 bool PossiblyHasMarkers(DocumentMarker::MarkerTypes); 123 bool PossiblyHasMarkers(DocumentMarker::MarkerTypes);
127 void RemoveMarkersFromList(MarkerMap::iterator, DocumentMarker::MarkerTypes); 124 void RemoveMarkersFromList(MarkerMap::iterator, DocumentMarker::MarkerTypes);
128 void RemoveMarkers(TextIterator&, DocumentMarker::MarkerTypes); 125 void RemoveMarkers(TextIterator&, DocumentMarker::MarkerTypes);
129 void RemoveMarkersInternal(Node*, 126 void RemoveMarkersInternal(Node*,
130 unsigned start_offset, 127 unsigned start_offset,
131 int length, 128 int length,
132 DocumentMarker::MarkerTypes); 129 DocumentMarker::MarkerTypes);
133 130
134 MarkerMap markers_; 131 MarkerMap markers_;
135 // Provide a quick way to determine whether a particular marker type is absent 132 // Provide a quick way to determine whether a particular marker type is absent
136 // without going through the map. 133 // without going through the map.
137 DocumentMarker::MarkerTypes possibly_existing_marker_types_; 134 DocumentMarker::MarkerTypes possibly_existing_marker_types_;
138 const Member<const Document> document_; 135 const Member<const Document> document_;
139 }; 136 };
140 137
141 } // namespace blink 138 } // namespace blink
142 139
143 #ifndef NDEBUG 140 #ifndef NDEBUG
144 void showDocumentMarkers(const blink::DocumentMarkerController*); 141 void showDocumentMarkers(const blink::DocumentMarkerController*);
145 #endif 142 #endif
146 143
147 #endif // DocumentMarkerController_h 144 #endif // DocumentMarkerController_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698