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

Unified Diff: third_party/WebKit/Source/core/editing/SelectionController.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: Rebase Created 5 years 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/SelectionController.cpp
diff --git a/third_party/WebKit/Source/core/editing/SelectionController.cpp b/third_party/WebKit/Source/core/editing/SelectionController.cpp
index 4f74bd149e559af1c3bac79731c5106b7ee23395..6a436361e9d5d70dbd12922f6da2c54fd0f3d0b1 100644
--- a/third_party/WebKit/Source/core/editing/SelectionController.cpp
+++ b/third_party/WebKit/Source/core/editing/SelectionController.cpp
@@ -75,10 +75,10 @@ void setSelectionIfNeeded(FrameSelection& selection, const VisibleSelectionTempl
selection.setSelection(newSelection);
}
-bool dispatchSelectStart(Node* node)
+WebInputEventResult dispatchSelectStart(Node* node)
{
if (!node || !node->layoutObject())
- return true;
+ return WebInputEventResult::NotHandled;
return node->dispatchEvent(Event::createCancelableBubble(EventTypeNames::selectstart));
}
@@ -218,7 +218,7 @@ void SelectionController::updateSelectionForMouseDragAlgorithm(const HitTestResu
}
}
- if (m_selectionState == SelectionState::HaveNotStartedSelection && !dispatchSelectStart(target))
+ if (m_selectionState == SelectionState::HaveNotStartedSelection && dispatchSelectStart(target) != WebInputEventResult::NotHandled)
return;
// TODO(yosin) We should check |mousePressNode|, |targetPosition|, and
@@ -271,7 +271,7 @@ bool SelectionController::updateSelectionForMouseDownDispatchingSelectStart(Node
if (targetNode && targetNode->layoutObject() && !targetNode->layoutObject()->isSelectable())
return false;
- if (!dispatchSelectStart(targetNode))
+ if (dispatchSelectStart(targetNode) != WebInputEventResult::NotHandled)
return false;
if (!selection.isValidFor(*m_frame->document()))

Powered by Google App Engine
This is Rietveld 408576698