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

Unified Diff: third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp

Issue 2701983002: Implement complete lifecycle transition for IdleSpellCheckCallback (Closed)
Patch Set: Fix compile error Created 3 years, 10 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/spellcheck/SpellChecker.cpp
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
index f13a3b9230f232e3b09b5606ed402ae9a345e741..7e80a6432ab7b6a9fc36e362e3300c959dbaaafe 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
@@ -930,8 +930,10 @@ static bool shouldCheckOldSelection(const Position& oldSelectionStart) {
void SpellChecker::respondToChangedSelection(
const Position& oldSelectionStart,
FrameSelection::SetSelectionOptions options) {
- if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled())
+ if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled()) {
+ m_idleSpellCheckCallback->setNeedsInvocation();
return;
+ }
TRACE_EVENT0("blink", "SpellChecker::respondToChangedSelection");
if (!isSpellCheckingEnabledFor(oldSelectionStart))
@@ -975,6 +977,12 @@ void SpellChecker::respondToChangedSelection(
spellCheckOldSelection(oldSelectionStart, newAdjacentWords);
}
+void SpellChecker::respondToChangedContents(const VisibleSelection& selection) {
+ updateMarkersForWordsAffectedByEditing(true);
+ if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled())
+ m_idleSpellCheckCallback->setNeedsInvocation();
+}
+
void SpellChecker::removeSpellingMarkers() {
frame().document()->markers().removeMarkers(
DocumentMarker::MisspellingMarkers());
@@ -1108,6 +1116,10 @@ void SpellChecker::cancelCheck() {
m_spellCheckRequester->cancelCheck();
}
+void SpellChecker::documentAttached(Document* document) {
+ m_idleSpellCheckCallback->documentAttached(document);
+}
+
DEFINE_TRACE(SpellChecker) {
visitor->trace(m_frame);
visitor->trace(m_spellCheckRequester);

Powered by Google App Engine
This is Rietveld 408576698