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

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

Issue 2566043003: Add new RuntimeEnabledFeature: IdleTimeSpellChecking (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 09180c0b33d185a5048041f167033598e7d71f3c..67f9b06c52d10896fa5dfb42a670911caa708aca 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
@@ -52,6 +52,7 @@
#include "core/loader/EmptyClients.h"
#include "core/page/Page.h"
#include "core/page/SpellCheckerClient.h"
+#include "platform/RuntimeEnabledFeatures.h"
#include "platform/text/TextBreakIterator.h"
#include "platform/text/TextCheckerClient.h"
@@ -187,6 +188,9 @@ void SpellChecker::toggleSpellCheckingEnabled() {
}
void SpellChecker::didBeginEditing(Element* element) {
+ if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled())
+ return;
+
if (!isSpellCheckingEnabled())
return;
@@ -366,6 +370,9 @@ void SpellChecker::clearMisspellingsForMovingParagraphs(
void SpellChecker::markMisspellingsForMovingParagraphs(
const VisibleSelection& movingSelection) {
+ if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled())
+ return;
+
// TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
// needs to be audited. See http://crbug.com/590369 for more details.
// In the long term we should use idle time spell checker to prevent
@@ -398,6 +405,9 @@ void SpellChecker::markMisspellingsInternal(const VisibleSelection& selection) {
void SpellChecker::markMisspellingsAfterApplyingCommand(
const CompositeEditCommand& cmd) {
+ if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled())
+ return;
+
if (!isSpellCheckingEnabled())
return;
if (!isSpellCheckingEnabledFor(cmd.endingSelection()))
@@ -868,6 +878,9 @@ static bool shouldCheckOldSelection(const Position& oldSelectionStart) {
void SpellChecker::respondToChangedSelection(
const Position& oldSelectionStart,
FrameSelection::SetSelectionOptions options) {
+ if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled())
+ return;
+
TRACE_EVENT0("blink", "SpellChecker::respondToChangedSelection");
if (!isSpellCheckingEnabledFor(oldSelectionStart))
return;
@@ -924,6 +937,9 @@ void SpellChecker::removeSpellingMarkersUnderWords(
}
void SpellChecker::spellCheckAfterBlur() {
+ if (RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled())
+ return;
+
if (!frame().selection().selection().isContentEditable())
return;
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698