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

Unified Diff: third_party/WebKit/Source/core/editing/Editor.h

Issue 2374743002: [InputEvent] Support |deleteByDrag|, |insertFromDrop| and fire in sequential order (Closed)
Patch Set: Yosin's review Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/editing/Editor.h
diff --git a/third_party/WebKit/Source/core/editing/Editor.h b/third_party/WebKit/Source/core/editing/Editor.h
index 9cae6e9bd54aea620e3c1c893c92f6c77d417c27..3991fbe74aaaf89d6d80894a25bae99c7e877ef4 100644
--- a/third_party/WebKit/Source/core/editing/Editor.h
+++ b/third_party/WebKit/Source/core/editing/Editor.h
@@ -44,6 +44,7 @@
namespace blink {
class CompositeEditCommand;
+class DragData;
class DummyPageHolder;
class EditCommandComposition;
class EditorClient;
@@ -58,6 +59,9 @@ class TextEvent;
class UndoStack;
enum class DeleteDirection;
+enum class SmartDelete { Yes, No };
yosin_UTC9 2016/10/03 09:19:03 How about enum class DeleteMode { Simple, Smart }?
chongz 2016/10/04 02:18:39 Done.
+enum class SmartInsert { Yes, No };
yosin_UTC9 2016/10/03 09:19:03 How about enum class InsertMode { Simple, Smart }?
chongz 2016/10/04 02:18:39 Done.
+enum class ChosePlainText { Yes, No };
yosin_UTC9 2016/10/03 09:19:03 How about DragSourceType { HTMLSource, PlainTextSo
chongz 2016/10/04 02:18:39 Done.
enum EditorCommandSource { CommandFromMenuOrKeyBinding, CommandFromDOM };
enum EditorParagraphSeparator { EditorParagraphSeparatorIsDiv, EditorParagraphSeparatorIsP };
@@ -106,10 +110,11 @@ public:
void removeFormattingAndStyle();
+ void registerCommandGroup(CompositeEditCommand* commandGroupWrapper);
void clearLastEditCommand();
bool deleteWithDirection(DeleteDirection, TextGranularity, bool killRing, bool isTypingAction);
- void deleteSelectionWithSmartDelete(bool smartDelete, InputEvent::InputType);
+ void deleteSelectionWithSmartDelete(bool smartDelete, InputEvent::InputType, const Position& referenceMovePosition = Position());
yosin_UTC9 2016/10/03 09:19:03 Is it better to use |SmartDelete| enum class inste
chongz 2016/10/04 02:18:39 Done.
void applyStyle(StylePropertySet*, InputEvent::InputType);
void applyParagraphStyle(StylePropertySet*, InputEvent::InputType);
@@ -205,6 +210,7 @@ public:
void pasteAsPlainText(const String&, bool smartReplace);
Element* findEventTargetFrom(const VisibleSelection&) const;
+ Element* findEventTargetFromSelection() const;
bool findString(const String&, FindOptions);
@@ -230,7 +236,10 @@ public:
// TODO(xiaochengh): Replace |bool| parameters by |enum|.
void replaceSelectionAfterDragging(DocumentFragment*, bool smartReplace, bool plainText);
- void moveSelectionAfterDragging(DocumentFragment*, const Position&, bool smartInsert, bool smartDelete);
+
+ // Return false if frame was destroyed by event handler, should stop executing remaining actions.
+ bool deleteSelectionAfterDraggingWithEvents(Element* dragSource, SmartDelete, const Position& referenceMovePosition);
+ bool replaceSelectionAfterDraggingWithEvents(Element* dropTarget, DragData*, DocumentFragment*, Range* dropCaretRange, SmartInsert, ChosePlainText);
EditorParagraphSeparator defaultParagraphSeparator() const { return m_defaultParagraphSeparator; }
void setDefaultParagraphSeparator(EditorParagraphSeparator separator) { m_defaultParagraphSeparator = separator; }
@@ -289,8 +298,6 @@ private:
void changeSelectionAfterCommand(const VisibleSelection& newSelection, FrameSelection::SetSelectionOptions);
void notifyComponentsOnChangedSelection();
- Element* findEventTargetFromSelection() const;
-
SpellChecker& spellChecker() const;
bool handleEditingKeyboardEvent(KeyboardEvent*);

Powered by Google App Engine
This is Rietveld 408576698