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

Unified Diff: ui/views/view_targeter.h

Issue 426443002: Do not call into EventTargeter methods from ViewTargeter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « no previous file | ui/views/view_targeter.cc » ('j') | ui/views/view_targeter.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view_targeter.h
diff --git a/ui/views/view_targeter.h b/ui/views/view_targeter.h
index 52e7a0e0ddd077568c94cac337ac8bb55230048c..66edc04257778a6089d79affc6629e8fd45620ee 100644
--- a/ui/views/view_targeter.h
+++ b/ui/views/view_targeter.h
@@ -13,13 +13,8 @@ namespace views {
class View;
class ViewTargeterDelegate;
-// Contains the logic used to determine the View to which an
-// event should be dispatched. A ViewTargeter (or one of its
-// derived classes) is installed on a View to specify the
-// targeting behaviour to be used for the subtree rooted at
-// that View.
-// TODO(tdanderson): Remove overrides of all EventHandler methods except for
-// FindTargetForEvent() and FindNextBestTarget().
+// A ViewTargeter is installed on a derived class of View that wishes to use
sadrul 2014/07/29 18:06:50 's/derived class of//' You should be able to inst
tdanderson 2014/07/29 19:40:45 Yep, this was careless wording on my part. Fixed.
+// the custom hit-testing or event-targeting behaviour defined by |delegate|.
class VIEWS_EXPORT ViewTargeter : public ui::EventTargeter {
public:
explicit ViewTargeter(ViewTargeterDelegate* delegate);
@@ -32,25 +27,15 @@ class VIEWS_EXPORT ViewTargeter : public ui::EventTargeter {
View* TargetForRect(View* root, const gfx::Rect& rect) const;
protected:
- // Returns the location of |event| represented as a rect. If |event| is
- // a gesture event, its bounding box is returned. Otherwise, a 1x1 rect
- // having its origin at the location of |event| is returned.
- gfx::RectF BoundsForEvent(const ui::LocatedEvent& event) const;
-
// ui::EventTargeter:
virtual ui::EventTarget* FindTargetForEvent(ui::EventTarget* root,
ui::Event* event) OVERRIDE;
virtual ui::EventTarget* FindNextBestTarget(ui::EventTarget* previous_target,
ui::Event* event) OVERRIDE;
- virtual bool SubtreeCanAcceptEvent(
sadrul 2014/07/29 18:06:50 How about keeping these with NOTREACHED()?
tdanderson 2014/07/29 19:40:45 Sure, seems reasonable. We can remove them entirel
- ui::EventTarget* target,
- const ui::LocatedEvent& event) const OVERRIDE;
- virtual bool EventLocationInsideBounds(
- ui::EventTarget* target,
- const ui::LocatedEvent& event) const OVERRIDE;
private:
- View* FindTargetForKeyEvent(View* view, const ui::KeyEvent& key);
+ View* FindTargetForKeyEvent(View* root, const ui::KeyEvent& key);
+ View* FindTargetForScrollEvent(View* root, const ui::ScrollEvent& scroll);
// ViewTargeter does not own the |delegate_|, but |delegate_| must
// outlive the targeter.
« no previous file with comments | « no previous file | ui/views/view_targeter.cc » ('j') | ui/views/view_targeter.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698