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

Unified Diff: third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp

Issue 2895253003: Split general DocumentMarkerController::AddMarker() method into spelling/grammar versions (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp
index 5e71a42497cf11a979fea3b59ff801262adae7b8..1f166a5e64ee127e0fa7f312f4c653cb2da949ea 100644
--- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp
@@ -123,10 +123,24 @@ void DocumentMarkerController::Clear() {
possibly_existing_marker_types_ = 0;
}
-void DocumentMarkerController::AddMarker(const Position& start,
- const Position& end,
- DocumentMarker::MarkerType type,
- const String& description) {
+void DocumentMarkerController::AddSpellingMarker(const Position& start,
+ const Position& end,
+ const String& description) {
+ AddSpellCheckMarker(start, end, DocumentMarker::kSpelling, description);
+}
+
+void DocumentMarkerController::AddGrammarMarker(const Position& start,
+ const Position& end,
+ const String& description) {
+ AddSpellCheckMarker(start, end, DocumentMarker::kGrammar, description);
+}
+
+void DocumentMarkerController::AddSpellCheckMarker(
+ const Position& start,
+ const Position& end,
+ DocumentMarker::MarkerType type,
+ const String& description) {
+ DCHECK(type == DocumentMarker::kSpelling || type == DocumentMarker::kGrammar);
yosin_UTC9 2017/05/23 09:35:04 nit: s/);/) << type;/
// Use a TextIterator to visit the potentially multiple nodes the range
// covers.
for (TextIterator marked_text(start, end); !marked_text.AtEnd();

Powered by Google App Engine
This is Rietveld 408576698