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

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: 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/SelectionController.cpp
diff --git a/third_party/WebKit/Source/core/editing/SelectionController.cpp b/third_party/WebKit/Source/core/editing/SelectionController.cpp
index 5369bad9283dadb9684d8255b36e6e723630aaa8..2b814c19cadef507adf798bef723c7441b1f7bc3 100644
--- a/third_party/WebKit/Source/core/editing/SelectionController.cpp
+++ b/third_party/WebKit/Source/core/editing/SelectionController.cpp
@@ -73,10 +73,10 @@ void setSelectionIfNeeded(FrameSelection& selection, const VisibleSelectionInFla
selection.setSelection(newSelection);
}
-bool dispatchSelectStart(Node* node)
+DispatchEventResult dispatchSelectStart(Node* node)
{
if (!node || !node->layoutObject())
- return true;
+ return DispatchEventResult::NotCanceled;
return node->dispatchEvent(Event::createCancelableBubble(EventTypeNames::selectstart));
}
@@ -217,7 +217,7 @@ void SelectionController::updateSelectionForMouseDrag(const HitTestResult& hitTe
}
}
- if (m_selectionState == SelectionState::HaveNotStartedSelection && !dispatchSelectStart(target))
+ if (m_selectionState == SelectionState::HaveNotStartedSelection && dispatchSelectStart(target) != DispatchEventResult::NotCanceled)
return;
// TODO(yosin) We should check |mousePressNode|, |targetPosition|, and
@@ -269,7 +269,7 @@ bool SelectionController::updateSelectionForMouseDownDispatchingSelectStart(Node
if (targetNode && targetNode->layoutObject() && !targetNode->layoutObject()->isSelectable())
return false;
- if (!dispatchSelectStart(targetNode))
+ if (dispatchSelectStart(targetNode) != DispatchEventResult::NotCanceled)
return false;
if (!selection.isValidFor(*m_frame->document()))
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.cpp ('k') | third_party/WebKit/Source/core/editing/SelectionEditor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698