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

Unified Diff: ui/events/event_targeter.h

Issue 1119423003: Refactors away method implementations in ui::EventTargeter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactors ui::EventTargeter (rebased) Created 5 years, 6 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
« no previous file with comments | « ui/events/event_processor_unittest.cc ('k') | ui/events/event_targeter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/event_targeter.h
diff --git a/ui/events/event_targeter.h b/ui/events/event_targeter.h
index 23b12614b5e5b2aab1f14065764cb4f0e0f26022..fbe7a0e0e7b0a8b7563c064244c6e4a0fd06bedf 100644
--- a/ui/events/event_targeter.h
+++ b/ui/events/event_targeter.h
@@ -6,18 +6,16 @@
#define UI_EVENTS_EVENT_TARGETER_H_
#include "base/compiler_specific.h"
-#include "ui/events/event.h"
#include "ui/events/events_export.h"
namespace ui {
class Event;
class EventTarget;
-class LocatedEvent;
class EVENTS_EXPORT EventTargeter {
public:
- virtual ~EventTargeter();
+ virtual ~EventTargeter() {}
// Returns the target |event| should be dispatched to. If there is no such
// target, return NULL. If |event| is a located event, the location of |event|
@@ -25,28 +23,7 @@ class EVENTS_EXPORT EventTargeter {
// the event (e.g., by changing the location of the event to be in the
// returned target's coordinate space) so that it can be dispatched to the
// target without any further modification.
- virtual EventTarget* FindTargetForEvent(EventTarget* root,
- Event* event);
-
- // Same as FindTargetForEvent(), but used for positional events. The location
- // etc. of |event| are in |root|'s coordinate system. When finding the target
- // for the event, the targeter can mutate the |event| (e.g. change the
- // coordinate to be in the returned target's coordinate system) so that it can
- // be dispatched to the target without any further modification.
- // TODO(tdanderson|sadrul): This should not be in the public API of
- // EventTargeter.
- virtual EventTarget* FindTargetForLocatedEvent(EventTarget* root,
- LocatedEvent* event);
-
- // Returns true if |target| or one of its descendants can be a target of
- // |event|. This requires that |target| and its descendants are not
- // prohibited from accepting the event, and that the event is within an
- // actionable region of the target's bounds. Note that the location etc. of
- // |event| is in |target|'s parent's coordinate system.
- // TODO(tdanderson|sadrul): This function should be made non-virtual and
- // non-public.
- virtual bool SubtreeShouldBeExploredForEvent(EventTarget* target,
- const LocatedEvent& event);
+ virtual EventTarget* FindTargetForEvent(EventTarget* root, Event* event) = 0;
// Returns the next best target for |event| as compared to |previous_target|.
// |event| is in the local coordinate space of |previous_target|.
@@ -54,22 +31,7 @@ class EVENTS_EXPORT EventTargeter {
// (e.g., by changing |event|'s location to be in the returned target's
// coordinate space).
virtual EventTarget* FindNextBestTarget(EventTarget* previous_target,
- Event* event);
-
- protected:
- // Returns false if neither |target| nor any of its descendants are allowed
- // to accept |event| for reasons unrelated to the event's location or the
- // target's bounds. For example, overrides of this function may consider
- // attributes such as the visibility or enabledness of |target|. Note that
- // the location etc. of |event| is in |target|'s parent's coordinate system.
- virtual bool SubtreeCanAcceptEvent(EventTarget* target,
- const LocatedEvent& event) const;
-
- // Returns whether the location of the event is in an actionable region of the
- // target. Note that the location etc. of |event| is in the |target|'s
- // parent's coordinate system.
- virtual bool EventLocationInsideBounds(EventTarget* target,
- const LocatedEvent& event) const;
+ Event* event) = 0;
};
} // namespace ui
« no previous file with comments | « ui/events/event_processor_unittest.cc ('k') | ui/events/event_targeter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698