Chromium Code Reviews| 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 |