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

Unified Diff: third_party/WebKit/Source/core/editing/SelectionEditor.cpp

Issue 1479923002: Enumerate the return value of dispatchEvent so it is clear. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_passive_uma_add
Patch Set: Fix typo Created 4 years, 10 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/SelectionEditor.cpp
diff --git a/third_party/WebKit/Source/core/editing/SelectionEditor.cpp b/third_party/WebKit/Source/core/editing/SelectionEditor.cpp
index ceb6aa9ebe551f9bb46063cc94bff0009a492056..c82677d716d40f0160c076afb579681bd79cc28a 100644
--- a/third_party/WebKit/Source/core/editing/SelectionEditor.cpp
+++ b/third_party/WebKit/Source/core/editing/SelectionEditor.cpp
@@ -586,7 +586,7 @@ bool SelectionEditor::modify(EAlteration alter, SelectionDirection direction, Te
trialFrameSelection->setSelection(m_selection);
trialFrameSelection->modify(alter, direction, granularity, NotUserTriggered);
- if (trialFrameSelection->selection().isRange() && m_selection.isCaret() && !dispatchSelectStart())
+ if (trialFrameSelection->selection().isRange() && m_selection.isCaret() && dispatchSelectStart() != DispatchEventResult::NotCanceled)
return false;
}
@@ -857,11 +857,11 @@ PassRefPtrWillBeRawPtr<Range> SelectionEditor::firstRange() const
return firstRangeOf(m_selection);
}
-bool SelectionEditor::dispatchSelectStart()
+DispatchEventResult SelectionEditor::dispatchSelectStart()
{
Node* selectStartTarget = m_selection.extent().computeContainerNode();
if (!selectStartTarget)
- return true;
+ return DispatchEventResult::NotCanceled;
return selectStartTarget->dispatchEvent(Event::createCancelableBubble(EventTypeNames::selectstart));
}
« no previous file with comments | « third_party/WebKit/Source/core/editing/SelectionEditor.h ('k') | third_party/WebKit/Source/core/events/DragEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698