| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |