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

Unified Diff: ui/aura/window_targeter.cc

Issue 139983009: ui::LocatedEvent location() returns gfx::PointF (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Undo accidental change. Created 6 years, 8 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
Index: ui/aura/window_targeter.cc
diff --git a/ui/aura/window_targeter.cc b/ui/aura/window_targeter.cc
index a572094af316c729edbe344ba9a7f058ecd73b08..4d03f1e25bed42836427b666c8638d66af356d96 100644
--- a/ui/aura/window_targeter.cc
+++ b/ui/aura/window_targeter.cc
@@ -29,8 +29,9 @@ bool WindowTargeter::WindowCanAcceptEvent(aura::Window* window,
return false;
Window* parent = window->parent();
- if (parent && parent->delegate_ && !parent->delegate_->
- ShouldDescendIntoChildForEventHandling(window, event.location())) {
+ if (parent && parent->delegate_ &&
+ !parent->delegate_->ShouldDescendIntoChildForEventHandling(
+ window, gfx::ToFlooredPoint(event.location()))) {
return false;
}
return true;
@@ -38,7 +39,7 @@ bool WindowTargeter::WindowCanAcceptEvent(aura::Window* window,
bool WindowTargeter::EventLocationInsideBounds(
aura::Window* window, const ui::LocatedEvent& event) const {
- gfx::Point point = event.location();
+ gfx::Point point = gfx::ToFlooredPoint(event.location());
if (window->parent())
aura::Window::ConvertPointToTarget(window->parent(), window, &point);
return gfx::Rect(window->bounds().size()).Contains(point);
@@ -132,14 +133,13 @@ Window* WindowTargeter::FindTargetInRootWindow(Window* root_window,
ui::GestureRecognizer::Get()->GetTouchLockedTarget(touch);
if (consumer)
return static_cast<Window*>(consumer);
- consumer =
- ui::GestureRecognizer::Get()->GetTargetForLocation(
- event.location(), touch.source_device_id());
+ consumer = ui::GestureRecognizer::Get()->GetTargetForLocation(
+ gfx::ToFlooredPoint(event.location()), touch.source_device_id());
if (consumer)
return static_cast<Window*>(consumer);
// If the initial touch is outside the root window, target the root.
- if (!root_window->bounds().Contains(event.location()))
+ if (!root_window->bounds().Contains(gfx::ToFlooredPoint(event.location())))
return root_window;
}

Powered by Google App Engine
This is Rietveld 408576698