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

Unified Diff: ui/views/view.cc

Issue 381323002: [rough WIP] Make View::GetEventHandlerForRect() non-virtual (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase cleanup 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 | « ui/views/view.h ('k') | ui/views/view_targeter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view.cc
diff --git a/ui/views/view.cc b/ui/views/view.cc
index 2961ed786613ab3101e7d63bbc3954f18aa13977..ef43e348c1b85fbb3b04a6a25a9e3f726839e851 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -28,7 +28,7 @@
#include "ui/gfx/path.h"
#include "ui/gfx/point3_f.h"
#include "ui/gfx/point_conversions.h"
-#include "ui/gfx/rect_conversions.h"
+//#include "ui/gfx/rect_conversions.h"
#include "ui/gfx/scoped_canvas.h"
#include "ui/gfx/screen.h"
#include "ui/gfx/skia_util.h"
@@ -41,7 +41,7 @@
#include "ui/views/drag_controller.h"
#include "ui/views/focus/view_storage.h"
#include "ui/views/layout/layout_manager.h"
-#include "ui/views/rect_based_targeting_utils.h"
+//#include "ui/views/rect_based_targeting_utils.h"
#include "ui/views/views_delegate.h"
#include "ui/views/widget/native_widget_private.h"
#include "ui/views/widget/root_view.h"
@@ -60,11 +60,6 @@ const bool kContextMenuOnMousePress = false;
const bool kContextMenuOnMousePress = true;
#endif
-// The minimum percentage of a view's area that needs to be covered by a rect
-// representing a touch region in order for that view to be considered by the
-// rect-based targeting algorithm.
-static const float kRectTargetOverlap = 0.6f;
-
// Default horizontal drag threshold in pixels.
// Same as what gtk uses.
const int kDefaultHorizontalDragThreshold = 8;
@@ -835,6 +830,14 @@ View* View::GetEventHandlerForPoint(const gfx::Point& point) {
}
View* View::GetEventHandlerForRect(const gfx::Rect& rect) {
+ // Terry - make a helper for this logic
+ ViewTargeter* view_targeter = targeter();
+ if (!view_targeter)
+ view_targeter = GetWidget()->GetRootView()->targeter();
+ CHECK(view_targeter);
+ return view_targeter->TargetForRect(this, rect);
+
+ /*
// |rect_view| represents the current best candidate to return
// if rect-based targeting (i.e., fuzzing) is used.
// |rect_view_distance| is used to keep track of the distance
@@ -906,6 +909,7 @@ View* View::GetEventHandlerForRect(const gfx::Rect& rect) {
}
return rect_view ? rect_view : point_view;
+ */
}
bool View::CanProcessEventsWithinSubtree() const {
« no previous file with comments | « ui/views/view.h ('k') | ui/views/view_targeter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698