Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef SetCharacterDataCommand_h | |
| 6 #define SetCharacterDataCommand_h | |
| 7 | |
| 8 #include "core/editing/commands/EditCommand.h" | |
| 9 | |
| 10 namespace blink { | |
| 11 | |
| 12 class CORE_EXPORT SetCharacterDataCommand final : public SimpleEditCommand { | |
| 13 public: | |
| 14 static SetCharacterDataCommand* create(Text* node, | |
| 15 unsigned offset, | |
| 16 unsigned count, | |
| 17 const String& text) { | |
| 18 return new SetCharacterDataCommand(node, offset, count, text); | |
| 19 } | |
| 20 | |
| 21 // EditCommand implementation | |
| 22 void doUnapply() final; | |
|
Xiaocheng
2017/02/21 23:37:32
Hiding doUnapply() as private ensures that only vi
| |
| 23 | |
| 24 DECLARE_VIRTUAL_TRACE(); | |
| 25 | |
| 26 private: | |
| 27 SetCharacterDataCommand(Text* node, | |
| 28 unsigned offset, | |
| 29 unsigned count, | |
| 30 const String& text); | |
| 31 | |
| 32 // EditCommand implementation | |
| 33 void doApply(EditingState*) final; | |
| 34 | |
| 35 const Member<Text> m_node; | |
| 36 const unsigned m_offset; | |
| 37 const unsigned m_count; | |
| 38 String m_previousTextForUndo; | |
| 39 const String m_newText; | |
| 40 }; | |
| 41 | |
| 42 } // namespace blink | |
| 43 | |
| 44 #endif // SetCharacterDataCommand_h | |
| OLD | NEW |