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

Unified Diff: third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h

Issue 2610063008: [InputEvent] Introduce temporary flag |BeforeInputTiming| (1/11) (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.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/commands/CompositeEditCommand.h
diff --git a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h
index f6c2930ffa5ed34bbca22557c192a8fac3e8c561..2f9f88cb64664d52c01f0536ab9e05b3528bc676 100644
--- a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h
+++ b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h
@@ -43,6 +43,9 @@ class HTMLSpanElement;
class Text;
enum class EditCommandSource { kMenuOrKeyBinding, kDOM };
+// TODO(chongz): Remove after we have moved all 'beforeinput' logic here.
+// https://crbug.com/670035.
+enum class BeforeInputTiming { kHasFiredBeforeCommand, kShouldFireInCommand };
class EditCommandComposition final : public UndoStep {
public:
@@ -81,8 +84,8 @@ class EditCommandComposition final : public UndoStep {
// * "beforeinput" was canceled, or
// * |frame| was destroyed by event handlers.
// Note: Undo stack will always get popped.
- bool willUnapply(EditCommandSource);
- bool willReapply(EditCommandSource);
+ bool willUnapply(EditCommandSource, BeforeInputTiming);
+ bool willReapply(EditCommandSource, BeforeInputTiming);
Member<Document> m_document;
VisibleSelection m_startingSelection;
@@ -100,7 +103,8 @@ class CORE_EXPORT CompositeEditCommand : public EditCommand {
~CompositeEditCommand() override;
// Returns |false| if the command failed. e.g. It's aborted.
- bool apply(EditCommandSource);
+ bool apply(EditCommandSource,
+ BeforeInputTiming = BeforeInputTiming::kHasFiredBeforeCommand);
bool isFirstCommand(EditCommand* command) {
return !m_commands.isEmpty() && m_commands.front() == command;
}
@@ -129,7 +133,7 @@ class CORE_EXPORT CompositeEditCommand : public EditCommand {
// |willApplyEditing()| should be called from
// * |CompositeEditCommand::apply()|, and
// * |TypingCommand::willAddTypingToOpenCommand()|.
- bool willApplyEditing(EditCommandSource);
+ bool willApplyEditing(EditCommandSource, BeforeInputTiming);
//
// sugary-sweet convenience functions to help create and apply edit commands
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698