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

Side by Side Diff: third_party/WebKit/Source/core/events/PointerEvent.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, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/events/PointerEvent.h" 5 #include "core/events/PointerEvent.h"
6 6
7 #include "core/dom/Element.h" 7 #include "core/dom/Element.h"
8 #include "core/events/EventDispatcher.h" 8 #include "core/events/EventDispatcher.h"
9 9
10 namespace blink { 10 namespace blink {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 PointerEventDispatchMediator::PointerEventDispatchMediator(PassRefPtrWillBeRawPt r<PointerEvent> pointerEvent) 76 PointerEventDispatchMediator::PointerEventDispatchMediator(PassRefPtrWillBeRawPt r<PointerEvent> pointerEvent)
77 : EventDispatchMediator(pointerEvent) 77 : EventDispatchMediator(pointerEvent)
78 { 78 {
79 } 79 }
80 80
81 PointerEvent& PointerEventDispatchMediator::event() const 81 PointerEvent& PointerEventDispatchMediator::event() const
82 { 82 {
83 return toPointerEvent(EventDispatchMediator::event()); 83 return toPointerEvent(EventDispatchMediator::event());
84 } 84 }
85 85
86 bool PointerEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) co nst 86 DispatchEventResult PointerEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) const
87 { 87 {
88 if (isDisabledFormControl(&dispatcher.node())) 88 if (isDisabledFormControl(&dispatcher.node()))
89 return false; 89 return DispatchEventResult::CanceledBeforeDispatch;
90 90
91 if (event().type().isEmpty()) 91 if (event().type().isEmpty())
92 return true; // Shouldn't happen. 92 return DispatchEventResult::NotCanceled; // Shouldn't happen.
93 93
94 ASSERT(!event().target() || event().target() != event().relatedTarget()); 94 ASSERT(!event().target() || event().target() != event().relatedTarget());
95 95
96 EventTarget* relatedTarget = event().relatedTarget(); 96 EventTarget* relatedTarget = event().relatedTarget();
97 event().eventPath().adjustForRelatedTarget(dispatcher.node(), relatedTarget) ; 97 event().eventPath().adjustForRelatedTarget(dispatcher.node(), relatedTarget) ;
98 98
99 dispatcher.dispatch(); 99 return dispatcher.dispatch();
100 return !event().defaultHandled() && !event().defaultPrevented();
101 } 100 }
102 101
103 } // namespace blink 102 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/events/PointerEvent.h ('k') | third_party/WebKit/Source/core/events/TouchEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698