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

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 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
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..180e357095173759b3b95c558f2b88a2c0acd66f
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/commands/DragAndDropCommand.h
@@ -0,0 +1,35 @@
+// 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.
+// 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