| 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/commands/UndoStep.h" | 5 #include "core/editing/commands/UndoStep.h" |
| 6 | 6 |
| 7 #include "core/editing/Editor.h" | 7 #include "core/editing/Editor.h" |
| 8 #include "core/editing/commands/EditCommand.h" | 8 #include "core/editing/commands/EditCommand.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 } | 69 } |
| 70 | 70 |
| 71 InputEvent::InputType UndoStep::inputType() const { | 71 InputEvent::InputType UndoStep::inputType() const { |
| 72 return m_inputType; | 72 return m_inputType; |
| 73 } | 73 } |
| 74 | 74 |
| 75 void UndoStep::append(SimpleEditCommand* command) { | 75 void UndoStep::append(SimpleEditCommand* command) { |
| 76 m_commands.push_back(command); | 76 m_commands.push_back(command); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void UndoStep::append(UndoStep* composition) { | 79 void UndoStep::append(UndoStep* undoStep) { |
| 80 m_commands.appendVector(composition->m_commands); | 80 m_commands.appendVector(undoStep->m_commands); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void UndoStep::setStartingSelection(const VisibleSelection& selection) { | 83 void UndoStep::setStartingSelection(const VisibleSelection& selection) { |
| 84 m_startingSelection = selection; | 84 m_startingSelection = selection; |
| 85 m_startingRootEditableElement = selection.rootEditableElement(); | 85 m_startingRootEditableElement = selection.rootEditableElement(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void UndoStep::setEndingSelection(const VisibleSelection& selection) { | 88 void UndoStep::setEndingSelection(const VisibleSelection& selection) { |
| 89 m_endingSelection = selection; | 89 m_endingSelection = selection; |
| 90 m_endingRootEditableElement = selection.rootEditableElement(); | 90 m_endingRootEditableElement = selection.rootEditableElement(); |
| 91 } | 91 } |
| 92 | 92 |
| 93 DEFINE_TRACE(UndoStep) { | 93 DEFINE_TRACE(UndoStep) { |
| 94 visitor->trace(m_document); | 94 visitor->trace(m_document); |
| 95 visitor->trace(m_startingSelection); | 95 visitor->trace(m_startingSelection); |
| 96 visitor->trace(m_endingSelection); | 96 visitor->trace(m_endingSelection); |
| 97 visitor->trace(m_commands); | 97 visitor->trace(m_commands); |
| 98 visitor->trace(m_startingRootEditableElement); | 98 visitor->trace(m_startingRootEditableElement); |
| 99 visitor->trace(m_endingRootEditableElement); | 99 visitor->trace(m_endingRootEditableElement); |
| 100 } | 100 } |
| 101 | 101 |
| 102 } // namespace blink | 102 } // namespace blink |
| OLD | NEW |