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

Unified Diff: third_party/WebKit/Source/core/editing/commands/DragAndDropCommand.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/commands/DragAndDropCommand.h
diff --git a/third_party/WebKit/Source/core/editing/commands/DragAndDropCommand.h b/third_party/WebKit/Source/core/editing/commands/DragAndDropCommand.h
new file mode 100644
index 0000000000000000000000000000000000000000..e536ad0fa5b32f04bfbc1114671b71057a055eca
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/commands/DragAndDropCommand.h
@@ -0,0 +1,33 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef DragAndDropCommand_h
+#define DragAndDropCommand_h
+
+#include "core/editing/commands/CompositeEditCommand.h"
+
+namespace blink {
+
+// |DragAndDropCommand| is a dummy command. It doesn't do anything by itself, but will act as a catcher for the following |DeleteByDrag| and |InsertFromDrop| commands, and combine them into a single undo entry.
yosin_UTC9 2016/10/03 09:19:03 Could you reflow a comment to fit in 80 chars / li
chongz 2016/10/04 02:18:39 Done.
+// In the future when necessary, this mechanism can be generalized into a common command wrapper to achieve undo group.
+class DragAndDropCommand final : public CompositeEditCommand {
+public:
+ static DragAndDropCommand* create(Document& document)
+ {
+ return new DragAndDropCommand(document);
+ }
+
+ bool isCommandGroupWrapper() const override;
+ bool isDragAndDropCommand() const override;
+
+private:
+ explicit DragAndDropCommand(Document&);
+
+ void doApply(EditingState*) override;
+ InputEvent::InputType inputType() const override;
+};
+
+} // namespace blink
+
+#endif // DragAndDropCommand_h

Powered by Google App Engine
This is Rietveld 408576698