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

Side by Side Diff: third_party/WebKit/Source/core/editing/Editor.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) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 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 27 matching lines...) Expand all
38 #include "core/editing/iterators/TextIterator.h" 38 #include "core/editing/iterators/TextIterator.h"
39 #include "core/editing/markers/DocumentMarker.h" 39 #include "core/editing/markers/DocumentMarker.h"
40 #include "core/events/InputEvent.h" 40 #include "core/events/InputEvent.h"
41 #include "platform/PasteMode.h" 41 #include "platform/PasteMode.h"
42 #include "platform/heap/Handle.h" 42 #include "platform/heap/Handle.h"
43 #include <memory> 43 #include <memory>
44 44
45 namespace blink { 45 namespace blink {
46 46
47 class CompositeEditCommand; 47 class CompositeEditCommand;
48 class DragData;
49 class EditCommandComposition; 48 class EditCommandComposition;
50 class EditorClient; 49 class EditorClient;
51 class EditorInternalCommand; 50 class EditorInternalCommand;
52 class LocalFrame; 51 class LocalFrame;
53 class HitTestResult; 52 class HitTestResult;
54 class KillRing; 53 class KillRing;
55 class Pasteboard; 54 class Pasteboard;
56 class SpellChecker; 55 class SpellChecker;
57 class StylePropertySet; 56 class StylePropertySet;
58 class TextEvent; 57 class TextEvent;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 166
168 // Returns 0 if this Command is not supported. 167 // Returns 0 if this Command is not supported.
169 int idForHistogram() const; 168 int idForHistogram() const;
170 169
171 private: 170 private:
172 LocalFrame& frame() const { 171 LocalFrame& frame() const {
173 DCHECK(m_frame); 172 DCHECK(m_frame);
174 return *m_frame; 173 return *m_frame;
175 } 174 }
176 175
177 // Returns target ranges for the command, currently only supports delete
178 // related commands. Used by InputEvent.
179 RangeVector* getTargetRanges() const;
chongz 2016/12/20 23:27:52 Moved to |TypingCommand::targetRangesForInputEvent
180
181 const EditorInternalCommand* m_command; 176 const EditorInternalCommand* m_command;
182 EditCommandSource m_source; 177 EditCommandSource m_source;
183 Member<LocalFrame> m_frame; 178 Member<LocalFrame> m_frame;
184 }; 179 };
185 // Command source is |EditCommandSource::kMenuOrKeyBinding|. 180 // Command source is |EditCommandSource::kMenuOrKeyBinding|.
186 Command createCommand(const String& commandName); 181 Command createCommand(const String& commandName);
187 // Command source is |EditCommandSource::kDOM|. 182 // Command source is |EditCommandSource::kDOM|.
188 Command createCommandFromDOM(const String& commandName); 183 Command createCommandFromDOM(const String& commandName);
189 184
190 // |Editor::executeCommand| is implementation of |WebFrame::executeCommand| 185 // |Editor::executeCommand| is implementation of |WebFrame::executeCommand|
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 272
278 // Implementation of WebLocalFrameImpl::replaceSelection. 273 // Implementation of WebLocalFrameImpl::replaceSelection.
279 void replaceSelection(const String&); 274 void replaceSelection(const String&);
280 // Implementation of SpellChecker::replaceMisspelledRange. 275 // Implementation of SpellChecker::replaceMisspelledRange.
281 void replaceSelectionForSpellChecker(const String&); 276 void replaceSelectionForSpellChecker(const String&);
282 277
283 void replaceSelectionAfterDragging(DocumentFragment*, 278 void replaceSelectionAfterDragging(DocumentFragment*,
284 InsertMode, 279 InsertMode,
285 DragSourceType); 280 DragSourceType);
286 281
287 // Return false if frame was destroyed by event handler, should stop executing
288 // remaining actions.
289 bool deleteSelectionAfterDraggingWithEvents(
chongz 2016/12/20 23:27:52 Removed, covered by |DeleteSelectionCommand => wil
290 Element* dragSource,
291 DeleteMode,
292 const Position& referenceMovePosition);
293 bool replaceSelectionAfterDraggingWithEvents(Element* dropTarget,
chongz 2016/12/20 23:27:52 Removed, covered by |ReplaceSelectionCommand => wi
294 DragData*,
295 DocumentFragment*,
296 Range* dropCaretRange,
297 InsertMode,
298 DragSourceType);
299
300 EditorParagraphSeparator defaultParagraphSeparator() const { 282 EditorParagraphSeparator defaultParagraphSeparator() const {
301 return m_defaultParagraphSeparator; 283 return m_defaultParagraphSeparator;
302 } 284 }
303 void setDefaultParagraphSeparator(EditorParagraphSeparator separator) { 285 void setDefaultParagraphSeparator(EditorParagraphSeparator separator) {
304 m_defaultParagraphSeparator = separator; 286 m_defaultParagraphSeparator = separator;
305 } 287 }
306 288
307 static void tidyUpHTMLStructure(Document&); 289 static void tidyUpHTMLStructure(Document&);
308 290
309 class RevealSelectionScope { 291 class RevealSelectionScope {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 m_mark = selection; 362 m_mark = selection;
381 } 363 }
382 364
383 inline bool Editor::markedTextMatchesAreHighlighted() const { 365 inline bool Editor::markedTextMatchesAreHighlighted() const {
384 return m_areMarkedTextMatchesHighlighted; 366 return m_areMarkedTextMatchesHighlighted;
385 } 367 }
386 368
387 } // namespace blink 369 } // namespace blink
388 370
389 #endif // Editor_h 371 #endif // Editor_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698