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

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: Split off InputMethodControllerTest changes, make other requested changes 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..d1fb701bde37d3aa065a952e8470581da83dc739 100644
--- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp
@@ -123,10 +123,25 @@ 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)
+ << 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