Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: third_party/WebKit/Source/core/editing/commands/SetCharacterDataCommand.h

Issue 2706033007: Add SetCharacterDataCommand (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698