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

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

Issue 2701983002: Implement complete lifecycle transition for IdleSpellCheckCallback (Closed)
Patch Set: Fix compiler 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 bbde6b096c1b1a4d66f6080f7e25d58cad78f4a0..9858b900b618eebce8e54217f3ba1a1d552e3ee8 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
@@ -923,8 +923,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))
@@ -968,6 +970,12 @@ void SpellChecker::respondToChangedSelection(
spellCheckOldSelection(oldSelectionStart, newAdjacentWords);
}
+void SpellChecker::respondToChangedContents() {
+ updateMarkersForWordsAffectedByEditing(true);
+ if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled())
+ m_idleSpellCheckCallback->setNeedsInvocation();
+}
+
void SpellChecker::removeSpellingMarkers() {
frame().document()->markers().removeMarkers(
DocumentMarker::MisspellingMarkers());
@@ -1101,6 +1109,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);
« no previous file with comments | « third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.h ('k') | third_party/WebKit/Source/core/frame/LocalFrame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698