| Index: third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp b/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp
|
| index 9cd36b618bcc1511e719c9a7a7ea06bb3cc28c1e..3e698065b03c02a79c08516cd4f753f54e77e3eb 100644
|
| --- a/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarker.cpp
|
| @@ -133,33 +133,43 @@ inline TextCompositionMarkerDetails* toTextCompositionMarkerDetails(
|
| DocumentMarker::DocumentMarker(MarkerType type,
|
| unsigned startOffset,
|
| unsigned endOffset,
|
| - const String& description)
|
| + DocumentMarkerDetails* details)
|
| : m_type(type),
|
| m_startOffset(startOffset),
|
| m_endOffset(endOffset),
|
| - m_details(description.isEmpty()
|
| - ? nullptr
|
| - : DocumentMarkerDescription::create(description)) {}
|
| + m_details(details) {}
|
| +
|
| +DocumentMarker* DocumentMarker::createCompositionMarker(unsigned startOffset,
|
| + unsigned endOffset,
|
| + Color underlineColor,
|
| + bool thick,
|
| + Color backgroundColor) {
|
| + return new DocumentMarker(Composition, startOffset, endOffset,
|
| + TextCompositionMarkerDetails::create(
|
| + underlineColor, thick, backgroundColor));
|
| +}
|
|
|
| -DocumentMarker::DocumentMarker(unsigned startOffset,
|
| - unsigned endOffset,
|
| - bool activeMatch)
|
| - : m_type(DocumentMarker::TextMatch),
|
| - m_startOffset(startOffset),
|
| - m_endOffset(endOffset),
|
| - m_details(DocumentMarkerTextMatch::create(activeMatch)) {}
|
| +DocumentMarker* DocumentMarker::createGrammarMarker(unsigned startOffset,
|
| + unsigned endOffset,
|
| + const String& description) {
|
| + return new DocumentMarker(Grammar, startOffset, endOffset,
|
| + DocumentMarkerDescription::create(description));
|
| +}
|
|
|
| -DocumentMarker::DocumentMarker(unsigned startOffset,
|
| - unsigned endOffset,
|
| - Color underlineColor,
|
| - bool thick,
|
| - Color backgroundColor)
|
| - : m_type(DocumentMarker::Composition),
|
| - m_startOffset(startOffset),
|
| - m_endOffset(endOffset),
|
| - m_details(TextCompositionMarkerDetails::create(underlineColor,
|
| - thick,
|
| - backgroundColor)) {}
|
| +DocumentMarker* DocumentMarker::createSpellingMarker(
|
| + unsigned startOffset,
|
| + unsigned endOffset,
|
| + const String& description) {
|
| + return new DocumentMarker(Spelling, startOffset, endOffset,
|
| + DocumentMarkerDescription::create(description));
|
| +}
|
| +
|
| +DocumentMarker* DocumentMarker::createTextMatchMarker(unsigned startOffset,
|
| + unsigned endOffset,
|
| + bool activeMatch) {
|
| + return new DocumentMarker(TextMatch, startOffset, endOffset,
|
| + DocumentMarkerTextMatch::create(activeMatch));
|
| +}
|
|
|
| DocumentMarker::DocumentMarker(const DocumentMarker& marker)
|
| : m_type(marker.type()),
|
|
|