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 5295203b934ae952c4f4068af6a611bf04dc981f..a9309fae840172d93c5b50057c0fa4918ed1b977 100644 |
--- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp |
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp |
@@ -34,6 +34,8 @@ |
#include "core/dom/Text.h" |
#include "core/editing/VisibleUnits.h" |
#include "core/editing/iterators/TextIterator.h" |
+#include "core/editing/markers/ActiveSuggestionMarker.h" |
+#include "core/editing/markers/ActiveSuggestionMarkerListImpl.h" |
#include "core/editing/markers/CompositionMarker.h" |
#include "core/editing/markers/CompositionMarkerListImpl.h" |
#include "core/editing/markers/DocumentMarkerListEditor.h" |
@@ -65,6 +67,8 @@ DocumentMarker::MarkerTypeIndex MarkerTypeToMarkerIndex( |
return DocumentMarker::kTextMatchMarkerIndex; |
case DocumentMarker::kComposition: |
return DocumentMarker::kCompositionMarkerIndex; |
+ case DocumentMarker::kActiveSuggestion: |
+ return DocumentMarker::kActiveSuggestionMarkerIndex; |
} |
NOTREACHED(); |
@@ -73,6 +77,8 @@ DocumentMarker::MarkerTypeIndex MarkerTypeToMarkerIndex( |
DocumentMarkerList* CreateListForType(DocumentMarker::MarkerType type) { |
switch (type) { |
+ case DocumentMarker::kActiveSuggestion: |
+ return new ActiveSuggestionMarkerListImpl(); |
case DocumentMarker::kComposition: |
return new CompositionMarkerListImpl(); |
case DocumentMarker::kSpelling: |
@@ -163,6 +169,19 @@ void DocumentMarkerController::AddCompositionMarker( |
}); |
} |
+void DocumentMarkerController::AddActiveSuggestionMarker( |
+ const EphemeralRange& range, |
+ Color underline_color, |
+ StyleableMarker::Thickness thickness, |
+ Color background_color) { |
+ DCHECK(!document_->NeedsLayoutTreeUpdate()); |
+ AddMarkerInternal(range, [underline_color, thickness, background_color]( |
+ int start_offset, int end_offset) { |
+ return new ActiveSuggestionMarker(start_offset, end_offset, underline_color, |
+ thickness, background_color); |
+ }); |
+} |
+ |
void DocumentMarkerController::PrepareForDestruction() { |
Clear(); |
} |