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

Unified Diff: third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp

Issue 2627103003: [EditCommandSource] Pass source through |CompositeEditCommand| ctor instead of |apply(source)| (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
Index: third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
index 85fbcce80f3d152ca099a2db1a65105d949a1e3a..4343bcd266379e90ada2fdc1b1045425cc92c343 100644
--- a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
@@ -160,12 +160,13 @@ InputEvent::InputType inputTypeForTypingCommand(
using namespace HTMLNames;
TypingCommand::TypingCommand(Document& document,
+ EditCommandSource source,
ETypingCommand commandType,
const String& textToInsert,
Options options,
TextGranularity granularity,
TextCompositionType compositionType)
- : CompositeEditCommand(document),
+ : CompositeEditCommand(document, source),
m_commandType(commandType),
m_textToInsert(textToInsert),
m_openForMoreTyping(true),
@@ -213,7 +214,8 @@ void TypingCommand::deleteSelection(Document& document,
return;
}
- TypingCommand::create(document, DeleteSelection, "", options)->apply(source);
+ TypingCommand::create(document, source, DeleteSelection, "", options)
+ ->apply();
}
void TypingCommand::deleteKeyPressed(Document& document,
@@ -249,8 +251,8 @@ void TypingCommand::deleteKeyPressed(Document& document,
}
}
- TypingCommand::create(document, DeleteKey, "", options, granularity)
- ->apply(source);
+ TypingCommand::create(document, source, DeleteKey, "", options, granularity)
+ ->apply();
}
void TypingCommand::forwardDeleteKeyPressed(Document& document,
@@ -281,8 +283,9 @@ void TypingCommand::forwardDeleteKeyPressed(Document& document,
}
}
- TypingCommand::create(document, ForwardDeleteKey, "", options, granularity)
- ->apply(source);
+ TypingCommand::create(document, source, ForwardDeleteKey, "", options,
+ granularity)
+ ->apply();
}
String TypingCommand::textDataForInputEvent() const {
@@ -418,15 +421,15 @@ void TypingCommand::insertText(Document& document,
return;
}
- TypingCommand* command = TypingCommand::create(document, InsertText, newText,
- options, compositionType);
+ TypingCommand* command = TypingCommand::create(
+ document, source, InsertText, newText, options, compositionType);
bool changeSelection = selectionForInsertion != currentSelection;
if (changeSelection) {
command->setStartingSelection(selectionForInsertion);
command->setEndingVisibleSelection(selectionForInsertion);
}
command->m_isIncrementalInsertion = isIncrementalInsertion;
- const bool aborted = !(command->apply(source));
+ const bool aborted = !(command->apply());
if (changeSelection) {
command->setEndingVisibleSelection(currentSelection);
@@ -464,7 +467,8 @@ bool TypingCommand::insertLineBreak(Document& document,
return !editingState.isAborted();
}
- return TypingCommand::create(document, InsertLineBreak, "", 0)->apply(source);
+ return TypingCommand::create(document, source, InsertLineBreak, "", 0)
+ ->apply();
}
bool TypingCommand::insertParagraphSeparatorInQuotedContent(
@@ -485,9 +489,9 @@ bool TypingCommand::insertParagraphSeparatorInQuotedContent(
return !editingState.isAborted();
}
- return TypingCommand::create(document,
+ return TypingCommand::create(document, source,
InsertParagraphSeparatorInQuotedContent)
- ->apply(source);
+ ->apply();
}
bool TypingCommand::insertParagraphSeparator(Document& document,
@@ -508,8 +512,9 @@ bool TypingCommand::insertParagraphSeparator(Document& document,
return !editingState.isAborted();
}
- return TypingCommand::create(document, InsertParagraphSeparator, "", 0)
- ->apply(source);
+ return TypingCommand::create(document, source, InsertParagraphSeparator, "",
+ 0)
+ ->apply();
}
TypingCommand* TypingCommand::lastTypingCommandIfStillOpenForTyping(

Powered by Google App Engine
This is Rietveld 408576698