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

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

Issue 2580773002: Let IdleSpellCheckCallback take full control over SpellCheckRequester (Closed)
Patch Set: Add CORE_EXPORT to IdleRequestCallback Created 4 years 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 56fb4484fd2d59fee560c5a3b2bdab77ad3a53fd..664da652785132d4723d465ec769d1e66b5916de 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
@@ -798,7 +798,8 @@ void SpellChecker::didEndEditingOnTextField(Element* e) {
// Remove markers when deactivating a selection in an <input type="text"/>.
// Prevent new ones from appearing too.
- m_spellCheckRequester->cancelCheck();
+ if (!RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled())
+ m_spellCheckRequester->cancelCheck();
TextControlElement* textControlElement = toTextControlElement(e);
HTMLElement* innerEditor = textControlElement->innerEditorElement();
DocumentMarker::MarkerTypes markerTypes(DocumentMarker::Spelling);
@@ -1035,6 +1036,9 @@ void SpellChecker::removeMarkers(const VisibleSelection& selection,
frame().document()->markers().removeMarkers(range, markerTypes);
}
+// TODO(xiaochengh): This function is only used by unit tests. We should move it
+// to IdleSpellCheckCallback and modify unit tests to cope with idle time spell
+// checker.
void SpellChecker::cancelCheck() {
m_spellCheckRequester->cancelCheck();
}
@@ -1045,7 +1049,8 @@ DEFINE_TRACE(SpellChecker) {
}
void SpellChecker::prepareForLeakDetection() {
- m_spellCheckRequester->prepareForLeakDetection();
+ if (!RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled())
+ m_spellCheckRequester->prepareForLeakDetection();
}
Vector<TextCheckingResult> SpellChecker::findMisspellings(const String& text) {
« no previous file with comments | « third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.h ('k') | third_party/WebKit/Source/core/testing/Internals.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698