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

Unified Diff: third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp

Issue 2650113004: [WIP] Add support for Android SuggestionSpans when editing text (Closed)
Patch Set: Uploading the latest version from my repo so I can reference it Created 3 years, 8 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/commands/TypingCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
index 6382ae112ef75d7402e48413cfd378bd46655c88..be3c2be2fc9d9e13cdde28a7ea7daae24be372f9 100644
--- a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
@@ -33,6 +33,7 @@
#include "core/editing/Editor.h"
#include "core/editing/PlainTextRange.h"
#include "core/editing/SelectionModifier.h"
+#include "core/editing/TextSuggestionController.h"
#include "core/editing/VisiblePosition.h"
#include "core/editing/VisibleUnits.h"
#include "core/editing/commands/BreakBlockquoteCommand.h"
@@ -266,9 +267,13 @@ void TypingCommand::insertText(Document& document,
LocalFrame* frame = document.frame();
DCHECK(frame);
- if (!text.isEmpty())
+ if (!text.isEmpty()) {
+ bool firstCharIsSpaceOrNewline = isSpaceOrNewline(text[0]);
document.frame()->spellChecker().updateMarkersForWordsAffectedByEditing(
- isSpaceOrNewline(text[0]));
+ firstCharIsSpaceOrNewline);
+ frame->textSuggestionController().removeSuggestionMarkersAffectedByEditing(
+ firstCharIsSpaceOrNewline);
+ }
insertText(document, text, frame->selection().selectionInDOMTree(), options,
composition, isIncrementalInsertion);
@@ -693,6 +698,10 @@ void TypingCommand::deleteKeyPressed(TextGranularity granularity,
return;
frame->spellChecker().updateMarkersForWordsAffectedByEditing(false);
+ document()
+ .frame()
+ ->textSuggestionController()
+ .removeSuggestionMarkersAffectedByEditing(false);
VisibleSelection selectionToDelete;
VisibleSelection selectionAfterUndo;
@@ -851,6 +860,10 @@ void TypingCommand::forwardDeleteKeyPressed(TextGranularity granularity,
return;
frame->spellChecker().updateMarkersForWordsAffectedByEditing(false);
+ document()
+ .frame()
+ ->textSuggestionController()
+ .removeSuggestionMarkersAffectedByEditing(false);
VisibleSelection selectionToDelete;
VisibleSelection selectionAfterUndo;

Powered by Google App Engine
This is Rietveld 408576698