Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/commands/SetCharacterDataCommand.h |
| diff --git a/third_party/WebKit/Source/core/editing/commands/SetCharacterDataCommand.h b/third_party/WebKit/Source/core/editing/commands/SetCharacterDataCommand.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2fbc8a32d23acac35730cd6d220a0a47705db19e |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/editing/commands/SetCharacterDataCommand.h |
| @@ -0,0 +1,41 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
|
yosin_UTC9
2017/02/20 07:26:27
Could you move SetCharacterDataCommand in another
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef SetCharacterDataCommand_h |
| +#define SetCharacterDataCommand_h |
| + |
| +#include "core/editing/commands/EditCommand.h" |
| + |
| +namespace blink { |
| + |
| +class SetCharacterDataCommand final : public SimpleEditCommand { |
| + public: |
| + static SetCharacterDataCommand* create(Text* node, |
| + unsigned offset, |
| + unsigned count, |
| + const String& text) { |
| + return new SetCharacterDataCommand(node, offset, count, text); |
| + } |
| + |
| + DECLARE_VIRTUAL_TRACE(); |
| + |
| + private: |
| + SetCharacterDataCommand(Text* node, |
| + unsigned offset, |
| + unsigned count, |
| + const String& text); |
| + |
|
yosin_UTC9
2017/02/20 07:26:27
Could add a comment to note |doApply()| and |doUna
|
| + void doApply(EditingState*) override; |
|
yosin_UTC9
2017/02/20 07:26:27
nit: s/override/final/
|
| + void doUnapply() override; |
|
yosin_UTC9
2017/02/20 07:26:27
nit: s/override/final/
|
| + |
| + Member<Text> m_node; |
|
yosin_UTC9
2017/02/20 07:26:27
nit: Could you add |const| to all member variables
rlanday
2017/02/21 21:16:55
m_previousTextForUndo can't be const since it gets
|
| + unsigned m_offset; |
| + unsigned m_count; |
| + String m_previousTextForUndo; |
| + String m_newText; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // SetCharacterDataCommand_h |