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

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

Issue 2374743002: [InputEvent] Support |deleteByDrag|, |insertFromDrop| and fire in sequential order (Closed)
Patch Set: Yosin's review 2 Created 4 years, 2 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 static EditCommandComposition* create(Document*, 47 static EditCommandComposition* create(Document*,
48 const VisibleSelection&, 48 const VisibleSelection&,
49 const VisibleSelection&, 49 const VisibleSelection&,
50 InputEvent::InputType); 50 InputEvent::InputType);
51 51
52 bool belongsTo(const LocalFrame&) const override; 52 bool belongsTo(const LocalFrame&) const override;
53 void unapply() override; 53 void unapply() override;
54 void reapply() override; 54 void reapply() override;
55 InputEvent::InputType inputType() const override; 55 InputEvent::InputType inputType() const override;
56 void append(SimpleEditCommand*); 56 void append(SimpleEditCommand*);
57 void append(EditCommandComposition*);
57 58
58 const VisibleSelection& startingSelection() const { 59 const VisibleSelection& startingSelection() const {
59 return m_startingSelection; 60 return m_startingSelection;
60 } 61 }
61 const VisibleSelection& endingSelection() const { return m_endingSelection; } 62 const VisibleSelection& endingSelection() const { return m_endingSelection; }
62 void setStartingSelection(const VisibleSelection&); 63 void setStartingSelection(const VisibleSelection&);
63 void setEndingSelection(const VisibleSelection&); 64 void setEndingSelection(const VisibleSelection&);
64 Element* startingRootEditableElement() const { 65 Element* startingRootEditableElement() const {
65 return m_startingRootEditableElement.get(); 66 return m_startingRootEditableElement.get();
66 } 67 }
(...skipping 25 matching lines...) Expand all
92 93
93 ~CompositeEditCommand() override; 94 ~CompositeEditCommand() override;
94 95
95 // Returns |false| if the command failed. e.g. It's aborted. 96 // Returns |false| if the command failed. e.g. It's aborted.
96 bool apply(); 97 bool apply();
97 bool isFirstCommand(EditCommand* command) { 98 bool isFirstCommand(EditCommand* command) {
98 return !m_commands.isEmpty() && m_commands.first() == command; 99 return !m_commands.isEmpty() && m_commands.first() == command;
99 } 100 }
100 EditCommandComposition* composition() { return m_composition.get(); } 101 EditCommandComposition* composition() { return m_composition.get(); }
101 EditCommandComposition* ensureComposition(); 102 EditCommandComposition* ensureComposition();
103 // Append composition from an already applied command.
104 void appendCommandToComposite(CompositeEditCommand*);
102 105
103 virtual bool isReplaceSelectionCommand() const; 106 virtual bool isReplaceSelectionCommand() const;
104 virtual bool isTypingCommand() const; 107 virtual bool isTypingCommand() const;
108 virtual bool isCommandGroupWrapper() const;
109 virtual bool isDragAndDropCommand() const;
105 virtual bool preservesTypingStyle() const; 110 virtual bool preservesTypingStyle() const;
106 virtual void setShouldRetainAutocorrectionIndicator(bool); 111 virtual void setShouldRetainAutocorrectionIndicator(bool);
107 virtual bool shouldStopCaretBlinking() const { return false; } 112 virtual bool shouldStopCaretBlinking() const { return false; }
108 113
109 DECLARE_VIRTUAL_TRACE(); 114 DECLARE_VIRTUAL_TRACE();
110 115
111 protected: 116 protected:
112 explicit CompositeEditCommand(Document&); 117 explicit CompositeEditCommand(Document&);
113 118
114 // 119 //
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 269
265 DEFINE_TYPE_CASTS(CompositeEditCommand, 270 DEFINE_TYPE_CASTS(CompositeEditCommand,
266 EditCommand, 271 EditCommand,
267 command, 272 command,
268 command->isCompositeEditCommand(), 273 command->isCompositeEditCommand(),
269 command.isCompositeEditCommand()); 274 command.isCompositeEditCommand());
270 275
271 } // namespace blink 276 } // namespace blink
272 277
273 #endif // CompositeEditCommand_h 278 #endif // CompositeEditCommand_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698