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

Side by Side Diff: third_party/WebKit/Source/core/editing/spellcheck/IdleSpellCheckCallback.cpp

Issue 2744603004: Correct the activation of idle time spell checker on document attach (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/spellcheck/IdleSpellCheckCallbackTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/editing/spellcheck/IdleSpellCheckCallback.h" 5 #include "core/editing/spellcheck/IdleSpellCheckCallback.h"
6 6
7 #include "core/dom/IdleRequestOptions.h" 7 #include "core/dom/IdleRequestOptions.h"
8 #include "core/dom/TaskRunnerHelper.h" 8 #include "core/dom/TaskRunnerHelper.h"
9 #include "core/editing/EditingUtilities.h" 9 #include "core/editing/EditingUtilities.h"
10 #include "core/editing/Editor.h" 10 #include "core/editing/Editor.h"
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 bool IdleSpellCheckCallback::coldModeFinishesFullDocument() const { 239 bool IdleSpellCheckCallback::coldModeFinishesFullDocument() const {
240 if (m_needsMoreColdModeInvocationForTesting) { 240 if (m_needsMoreColdModeInvocationForTesting) {
241 m_needsMoreColdModeInvocationForTesting = false; 241 m_needsMoreColdModeInvocationForTesting = false;
242 return false; 242 return false;
243 } 243 }
244 244
245 return !m_nextNodeInColdMode; 245 return !m_nextNodeInColdMode;
246 } 246 }
247 247
248 void IdleSpellCheckCallback::handleEvent(IdleDeadline* deadline) { 248 void IdleSpellCheckCallback::handleEvent(IdleDeadline* deadline) {
249 DCHECK(RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled());
249 DCHECK(frame().document()); 250 DCHECK(frame().document());
250 DCHECK(frame().document()->isActive()); 251 DCHECK(frame().document()->isActive());
251 DCHECK_NE(m_idleCallbackHandle, kInvalidHandle); 252 DCHECK_NE(m_idleCallbackHandle, kInvalidHandle);
252 m_idleCallbackHandle = kInvalidHandle; 253 m_idleCallbackHandle = kInvalidHandle;
253 254
254 if (!isSpellCheckingEnabled()) { 255 if (!isSpellCheckingEnabled()) {
255 deactivate(); 256 deactivate();
256 return; 257 return;
257 } 258 }
258 259
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 } 309 }
309 } 310 }
310 311
311 void IdleSpellCheckCallback::skipColdModeTimerForTesting() { 312 void IdleSpellCheckCallback::skipColdModeTimerForTesting() {
312 DCHECK(m_coldModeTimer.isActive()); 313 DCHECK(m_coldModeTimer.isActive());
313 m_coldModeTimer.stop(); 314 m_coldModeTimer.stop();
314 coldModeTimerFired(&m_coldModeTimer); 315 coldModeTimerFired(&m_coldModeTimer);
315 } 316 }
316 317
317 } // namespace blink 318 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/spellcheck/IdleSpellCheckCallbackTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698