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

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

Issue 2790763002: Correct the activation of idle time spell checker on document attach (Closed)
Patch Set: Created 3 years, 8 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/FrameSelection.h" 10 #include "core/editing/FrameSelection.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 if (m_needsMoreColdModeInvocationForTesting) { 144 if (m_needsMoreColdModeInvocationForTesting) {
145 m_needsMoreColdModeInvocationForTesting = false; 145 m_needsMoreColdModeInvocationForTesting = false;
146 return false; 146 return false;
147 } 147 }
148 148
149 // TODO(xiaochengh): Implementation. 149 // TODO(xiaochengh): Implementation.
150 return true; 150 return true;
151 } 151 }
152 152
153 void IdleSpellCheckCallback::handleEvent(IdleDeadline* deadline) { 153 void IdleSpellCheckCallback::handleEvent(IdleDeadline* deadline) {
154 DCHECK(RuntimeEnabledFeatures::idleTimeSpellCheckingEnabled());
154 DCHECK(frame().document()); 155 DCHECK(frame().document());
155 DCHECK(frame().document()->isActive()); 156 DCHECK(frame().document()->isActive());
156 DCHECK_NE(m_idleCallbackHandle, kInvalidHandle); 157 DCHECK_NE(m_idleCallbackHandle, kInvalidHandle);
157 m_idleCallbackHandle = kInvalidHandle; 158 m_idleCallbackHandle = kInvalidHandle;
158 159
159 if (!isSpellCheckingEnabled()) { 160 if (!isSpellCheckingEnabled()) {
160 deactivate(); 161 deactivate();
161 return; 162 return;
162 } 163 }
163 164
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 } 214 }
214 } 215 }
215 216
216 void IdleSpellCheckCallback::skipColdModeTimerForTesting() { 217 void IdleSpellCheckCallback::skipColdModeTimerForTesting() {
217 DCHECK(m_coldModeTimer.isActive()); 218 DCHECK(m_coldModeTimer.isActive());
218 m_coldModeTimer.stop(); 219 m_coldModeTimer.stop();
219 coldModeTimerFired(&m_coldModeTimer); 220 coldModeTimerFired(&m_coldModeTimer);
220 } 221 }
221 222
222 } // namespace blink 223 } // 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