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

Unified Diff: chrome/browser/ui/views/tabs/tab.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: chrome/browser/ui/views/tabs/tab.cc
diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc
index 9a529f08c15c9217c784f4ecd3718d6352d9bd72..96a71b6447095f15d843ac28ec76c22772bf5967 100644
--- a/chrome/browser/ui/views/tabs/tab.cc
+++ b/chrome/browser/ui/views/tabs/tab.cc
@@ -902,14 +902,15 @@ void Tab::OnMouseReleased(const ui::MouseEvent& event) {
// (normal windows behavior is to discard presses of a UI element where the
// releases happen off the element).
if (event.IsMiddleMouseButton()) {
- if (HitTestPoint(event.location())) {
+ if (HitTestPoint(gfx::ToFlooredPoint(event.location()))) {
controller_->CloseTab(this, CLOSE_TAB_FROM_MOUSE);
} else if (closing_) {
// We're animating closed and a middle mouse button was pushed on us but
// we don't contain the mouse anymore. We assume the user is clicking
// quicker than the animation and we should close the tab that falls under
// the mouse.
- Tab* closest_tab = controller_->GetTabAt(this, event.location());
+ Tab* closest_tab =
+ controller_->GetTabAt(this, gfx::ToFlooredPoint(event.location()));
if (closest_tab)
controller_->CloseTab(closest_tab, CLOSE_TAB_FROM_MOUSE);
}
@@ -931,7 +932,7 @@ void Tab::OnMouseEntered(const ui::MouseEvent& event) {
}
void Tab::OnMouseMoved(const ui::MouseEvent& event) {
- hover_controller_.SetLocation(event.location());
+ hover_controller_.SetLocation(gfx::ToFlooredPoint(event.location()));
controller_->OnMouseEventInTab(this, event);
}
@@ -953,7 +954,7 @@ void Tab::OnGestureEvent(ui::GestureEvent* event) {
tab_activated_with_last_gesture_begin_ = !IsActive();
if (!IsSelected())
controller_->SelectTab(this);
- gfx::Point loc(event->location());
+ gfx::Point loc(gfx::ToFlooredPoint(event->location()));
views::View::ConvertPointToScreen(this, &loc);
ui::GestureEvent cloned_event(event_in_parent, parent(),
static_cast<View*>(this));

Powered by Google App Engine
This is Rietveld 408576698