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

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 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/editing/BUILD.gn ('k') | third_party/WebKit/Source/core/editing/Editor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 550e1b5e3b5a3f2b0c629c2bac8bc93d4b2020e3..030e6733c31d5b96a94e801472d9779e22947528 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 DeleteMode { Simple, Smart };
+enum class InsertMode { Simple, Smart };
+enum class DragSourceType { HTMLSource, PlainTextSource };
enum EditorCommandSource { CommandFromMenuOrKeyBinding, CommandFromDOM };
enum EditorParagraphSeparator {
@@ -110,13 +114,17 @@ class CORE_EXPORT Editor final : public GarbageCollectedFinalized<Editor> {
void removeFormattingAndStyle();
+ void registerCommandGroup(CompositeEditCommand* commandGroupWrapper);
void clearLastEditCommand();
bool deleteWithDirection(DeleteDirection,
TextGranularity,
bool killRing,
bool isTypingAction);
- void deleteSelectionWithSmartDelete(bool smartDelete, InputEvent::InputType);
+ void deleteSelectionWithSmartDelete(
+ DeleteMode,
+ InputEvent::InputType,
+ const Position& referenceMovePosition = Position());
void applyStyle(StylePropertySet*, InputEvent::InputType);
void applyParagraphStyle(StylePropertySet*, InputEvent::InputType);
@@ -218,6 +226,7 @@ class CORE_EXPORT Editor final : public GarbageCollectedFinalized<Editor> {
void pasteAsPlainText(const String&, bool smartReplace);
Element* findEventTargetFrom(const VisibleSelection&) const;
+ Element* findEventTargetFromSelection() const;
bool findString(const String&, FindOptions);
@@ -253,12 +262,20 @@ class CORE_EXPORT Editor final : public GarbageCollectedFinalized<Editor> {
// TODO(xiaochengh): Replace |bool| parameters by |enum|.
void replaceSelectionAfterDragging(DocumentFragment*,
- bool smartReplace,
- bool plainText);
- void moveSelectionAfterDragging(DocumentFragment*,
- const Position&,
- bool smartInsert,
- bool smartDelete);
+ InsertMode,
+ DragSourceType);
+
+ // Return false if frame was destroyed by event handler, should stop executing remaining actions.
+ bool deleteSelectionAfterDraggingWithEvents(
+ Element* dragSource,
+ DeleteMode,
+ const Position& referenceMovePosition);
+ bool replaceSelectionAfterDraggingWithEvents(Element* dropTarget,
+ DragData*,
+ DocumentFragment*,
+ Range* dropCaretRange,
+ InsertMode,
+ DragSourceType);
EditorParagraphSeparator defaultParagraphSeparator() const {
return m_defaultParagraphSeparator;
@@ -327,8 +344,6 @@ class CORE_EXPORT Editor final : public GarbageCollectedFinalized<Editor> {
FrameSelection::SetSelectionOptions);
void notifyComponentsOnChangedSelection();
- Element* findEventTargetFromSelection() const;
-
SpellChecker& spellChecker() const;
bool handleEditingKeyboardEvent(KeyboardEvent*);
« no previous file with comments | « third_party/WebKit/Source/core/editing/BUILD.gn ('k') | third_party/WebKit/Source/core/editing/Editor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698