| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/ColdModeSpellCheckRequester.h" | 5 #include "core/editing/spellcheck/ColdModeSpellCheckRequester.h" |
| 6 | 6 |
| 7 #include "core/dom/Element.h" | 7 #include "core/dom/Element.h" |
| 8 #include "core/dom/IdleDeadline.h" | 8 #include "core/dom/IdleDeadline.h" |
| 9 #include "core/editing/EditingUtilities.h" | 9 #include "core/editing/EditingUtilities.h" |
| 10 #include "core/editing/VisibleUnits.h" | 10 #include "core/editing/VisibleUnits.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 // TODO(editing-dev): Make |Position| constructors take const parameters. | 28 // TODO(editing-dev): Make |Position| constructors take const parameters. |
| 29 const Position& position = | 29 const Position& position = |
| 30 Position::firstPositionInNode(const_cast<Node*>(&node)); | 30 Position::firstPositionInNode(const_cast<Node*>(&node)); |
| 31 if (!isEditablePosition(position)) | 31 if (!isEditablePosition(position)) |
| 32 return false; | 32 return false; |
| 33 return SpellChecker::isSpellCheckingEnabledAt(position); | 33 return SpellChecker::isSpellCheckingEnabledAt(position); |
| 34 } | 34 } |
| 35 | 35 |
| 36 } // namespace | 36 } // namespace |
| 37 | 37 |
| 38 ColdModeSpellCheckRequester::~ColdModeSpellCheckRequester() = default; | |
| 39 | |
| 40 // static | 38 // static |
| 41 ColdModeSpellCheckRequester* ColdModeSpellCheckRequester::create( | 39 ColdModeSpellCheckRequester* ColdModeSpellCheckRequester::create( |
| 42 LocalFrame& frame) { | 40 LocalFrame& frame) { |
| 43 return new ColdModeSpellCheckRequester(frame); | 41 return new ColdModeSpellCheckRequester(frame); |
| 44 } | 42 } |
| 45 | 43 |
| 46 DEFINE_TRACE(ColdModeSpellCheckRequester) { | 44 DEFINE_TRACE(ColdModeSpellCheckRequester) { |
| 47 visitor->trace(m_frame); | 45 visitor->trace(m_frame); |
| 48 visitor->trace(m_nextNode); | 46 visitor->trace(m_nextNode); |
| 49 visitor->trace(m_currentRootEditable); | 47 visitor->trace(m_currentRootEditable); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 m_nextNode = FlatTreeTraversal::nextSkippingChildren( | 170 m_nextNode = FlatTreeTraversal::nextSkippingChildren( |
| 173 *m_nextNode, frame().document()->body()); | 171 *m_nextNode, frame().document()->body()); |
| 174 | 172 |
| 175 m_currentRootEditable = nullptr; | 173 m_currentRootEditable = nullptr; |
| 176 m_currentFullLength = kInvalidLength; | 174 m_currentFullLength = kInvalidLength; |
| 177 m_currentChunkIndex = kInvalidChunkIndex; | 175 m_currentChunkIndex = kInvalidChunkIndex; |
| 178 m_currentChunkStart = Position(); | 176 m_currentChunkStart = Position(); |
| 179 } | 177 } |
| 180 | 178 |
| 181 } // namespace blink | 179 } // namespace blink |
| OLD | NEW |