OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
yosin_UTC9
2017/02/20 07:26:27
Could you move SetCharacterDataCommand in another
| |
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 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 DECLARE_VIRTUAL_TRACE(); | |
22 | |
23 private: | |
24 SetCharacterDataCommand(Text* node, | |
25 unsigned offset, | |
26 unsigned count, | |
27 const String& text); | |
28 | |
yosin_UTC9
2017/02/20 07:26:27
Could add a comment to note |doApply()| and |doUna
| |
29 void doApply(EditingState*) override; | |
yosin_UTC9
2017/02/20 07:26:27
nit: s/override/final/
| |
30 void doUnapply() override; | |
yosin_UTC9
2017/02/20 07:26:27
nit: s/override/final/
| |
31 | |
32 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
| |
33 unsigned m_offset; | |
34 unsigned m_count; | |
35 String m_previousTextForUndo; | |
36 String m_newText; | |
37 }; | |
38 | |
39 } // namespace blink | |
40 | |
41 #endif // SetCharacterDataCommand_h | |
OLD | NEW |