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

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

Issue 2558643003: [InputEvent] Move 'beforeinput' logic into |CompositeEditCommand::willApplyEditing()| (3/3) (Closed)
Patch Set: xiaocheng's review: Isolate |UndoStep| code; Move attribuates to private Created 3 years, 12 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
1 /* 1 /*
2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 DECLARE_VIRTUAL_TRACE(); 61 DECLARE_VIRTUAL_TRACE();
62 62
63 private: 63 private:
64 ReplaceSelectionCommand(Document&, 64 ReplaceSelectionCommand(Document&,
65 DocumentFragment*, 65 DocumentFragment*,
66 CommandOptions, 66 CommandOptions,
67 InputEvent::InputType); 67 InputEvent::InputType);
68 68
69 void doApply(EditingState*) override; 69 void doApply(EditingState*) override;
70 InputEvent::InputType inputType() const override;
71 bool isReplaceSelectionCommand() const override; 70 bool isReplaceSelectionCommand() const override;
72 71
73 class InsertedNodes { 72 class InsertedNodes {
74 STACK_ALLOCATED(); 73 STACK_ALLOCATED();
75 74
76 public: 75 public:
77 void respondToNodeInsertion(Node&); 76 void respondToNodeInsertion(Node&);
78 void willRemoveNodePreservingChildren(Node&); 77 void willRemoveNodePreservingChildren(Node&);
79 void willRemoveNode(Node&); 78 void willRemoveNode(Node&);
80 void didReplaceNode(Node&, Node& newNode); 79 void didReplaceNode(Node&, Node& newNode);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 bool shouldPerformSmartReplace() const; 130 bool shouldPerformSmartReplace() const;
132 void addSpacesForSmartReplace(EditingState*); 131 void addSpacesForSmartReplace(EditingState*);
133 void completeHTMLReplacement(const Position& lastPositionToSelect, 132 void completeHTMLReplacement(const Position& lastPositionToSelect,
134 EditingState*); 133 EditingState*);
135 void mergeTextNodesAroundPosition(Position&, 134 void mergeTextNodesAroundPosition(Position&,
136 Position& positionOnlyToBeUpdated, 135 Position& positionOnlyToBeUpdated,
137 EditingState*); 136 EditingState*);
138 137
139 bool performTrivialReplace(const ReplacementFragment&, EditingState*); 138 bool performTrivialReplace(const ReplacementFragment&, EditingState*);
140 139
140 InputEvent::InputType inputType() const final;
141 String textDataForInputEvent() const final;
142 DataTransfer* dataTransferForInputEvent() const final;
143
141 Position m_startOfInsertedContent; 144 Position m_startOfInsertedContent;
142 Position m_endOfInsertedContent; 145 Position m_endOfInsertedContent;
143 Member<EditingStyle> m_insertionStyle; 146 Member<EditingStyle> m_insertionStyle;
144 bool m_selectReplacement; 147 bool m_selectReplacement;
145 bool m_smartReplace; 148 bool m_smartReplace;
146 bool m_matchStyle; 149 bool m_matchStyle;
147 Member<DocumentFragment> m_documentFragment; 150 Member<DocumentFragment> m_documentFragment;
148 bool m_preventNesting; 151 bool m_preventNesting;
149 bool m_movingParagraph; 152 bool m_movingParagraph;
150 InputEvent::InputType m_inputType; 153 InputEvent::InputType m_inputType;
151 bool m_sanitizeFragment; 154 bool m_sanitizeFragment;
152 bool m_shouldMergeEnd; 155 bool m_shouldMergeEnd;
153 156
154 Position m_startOfInsertedRange; 157 Position m_startOfInsertedRange;
155 Position m_endOfInsertedRange; 158 Position m_endOfInsertedRange;
156 }; 159 };
157 160
158 DEFINE_TYPE_CASTS(ReplaceSelectionCommand, 161 DEFINE_TYPE_CASTS(ReplaceSelectionCommand,
159 CompositeEditCommand, 162 CompositeEditCommand,
160 command, 163 command,
161 command->isReplaceSelectionCommand(), 164 command->isReplaceSelectionCommand(),
162 command.isReplaceSelectionCommand()); 165 command.isReplaceSelectionCommand());
163 166
164 } // namespace blink 167 } // namespace blink
165 168
166 #endif // ReplaceSelectionCommand_h 169 #endif // ReplaceSelectionCommand_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698