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

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

Issue 2101263002: [Editing][CodeHealth] Refactor SpellChecker::respondToChangedSelection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | no next file » | 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 5ced5f51e552afcf9632cbe705ffc64ad2f121cd..35ef14b21c14ffb28c171fb77e0e2354c2b99608 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
@@ -794,9 +794,8 @@ void SpellChecker::respondToChangedSelection(const VisibleSelection& oldSelectio
if (!isSpellCheckingEnabledFor(oldSelection))
return;
- bool closeTyping = options & FrameSelection::CloseTyping;
- bool isContinuousSpellCheckingEnabled = this->isContinuousSpellCheckingEnabled();
- bool isContinuousGrammarCheckingEnabled = isContinuousSpellCheckingEnabled;
+ const bool closeTyping = options & FrameSelection::CloseTyping;
+ const bool isContinuousSpellCheckingEnabled = this->isContinuousSpellCheckingEnabled();
if (isContinuousSpellCheckingEnabled && closeTyping && shouldCheckOldSelection(oldSelection)) {
VisibleSelection newAdjacentWords;
bool caretBrowsing = frame().settings() && frame().settings()->caretBrowsingEnabled();
@@ -821,10 +820,10 @@ void SpellChecker::respondToChangedSelection(const VisibleSelection& oldSelectio
}
// When continuous spell checking is off, existing markers disappear after the selection changes.
- if (!isContinuousSpellCheckingEnabled)
+ if (!isContinuousSpellCheckingEnabled) {
yosin_UTC9 2016/06/30 03:49:44 We prefer early return. When |isContinuousSpellCh
yoichio 2016/06/30 05:51:47 Done.
frame().document()->markers().removeMarkers(DocumentMarker::Spelling);
- if (!isContinuousGrammarCheckingEnabled)
frame().document()->markers().removeMarkers(DocumentMarker::Grammar);
+ }
}
void SpellChecker::removeSpellingMarkers()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698