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

Side by Side Diff: ui/views/view_targeter_delegate.h

Issue 401933002: Move views event targeting into ViewTargeterDelegate::TargetForRect() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments addressed 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/view_targeter.cc ('k') | ui/views/view_targeter_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef UI_VIEWS_VIEW_TARGETER_DELEGATE_H_ 5 #ifndef UI_VIEWS_VIEW_TARGETER_DELEGATE_H_
6 #define UI_VIEWS_VIEW_TARGETER_DELEGATE_H_ 6 #define UI_VIEWS_VIEW_TARGETER_DELEGATE_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "ui/views/views_export.h" 9 #include "ui/views/views_export.h"
10 10
(...skipping 11 matching lines...) Expand all
22 public: 22 public:
23 ViewTargeterDelegate() {} 23 ViewTargeterDelegate() {}
24 virtual ~ViewTargeterDelegate() {} 24 virtual ~ViewTargeterDelegate() {}
25 25
26 // Returns true if the bounds of |target| intersects |rect|, where |rect| 26 // Returns true if the bounds of |target| intersects |rect|, where |rect|
27 // is in the local coodinate space of |target|. Overrides of this method by 27 // is in the local coodinate space of |target|. Overrides of this method by
28 // a View subclass should enforce DCHECK_EQ(this, target). 28 // a View subclass should enforce DCHECK_EQ(this, target).
29 virtual bool DoesIntersectRect(const View* target, 29 virtual bool DoesIntersectRect(const View* target,
30 const gfx::Rect& rect) const; 30 const gfx::Rect& rect) const;
31 31
32 // If point-based targeting should be used, return the deepest visible
33 // descendant of |root| that contains the center point of |rect|.
34 // If rect-based targeting (i.e., fuzzing) should be used, return the
35 // closest visible descendant of |root| having at least kRectTargetOverlap of
36 // its area covered by |rect|. If no such descendant exists, return the
37 // deepest visible descendant of |root| that contains the center point of
38 // |rect|. See http://goo.gl/3Jp2BD for more information about rect-based
39 // targeting.
40 virtual View* TargetForRect(View* root, const gfx::Rect& rect);
41
32 private: 42 private:
33 DISALLOW_COPY_AND_ASSIGN(ViewTargeterDelegate); 43 DISALLOW_COPY_AND_ASSIGN(ViewTargeterDelegate);
34 }; 44 };
35 45
36 } // namespace views 46 } // namespace views
37 47
38 #endif // UI_VIEWS_VIEW_TARGETER_DELEGATE_H_ 48 #endif // UI_VIEWS_VIEW_TARGETER_DELEGATE_H_
OLDNEW
« no previous file with comments | « ui/views/view_targeter.cc ('k') | ui/views/view_targeter_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698