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

Unified Diff: chrome/browser/ui/views/tabs/tab_strip.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_strip.cc
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc
index 169d128faa2f31c7f85a841676eabcd731c45ef0..c61314ce89312930cc6dab590652e48c0fce9ef5 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -290,7 +290,7 @@ void NewTabButton::GetHitTestMask(HitTestSource source, gfx::Path* path) const {
#if defined(OS_WIN)
void NewTabButton::OnMouseReleased(const ui::MouseEvent& event) {
if (event.IsOnlyRightMouseButton()) {
- gfx::Point point = event.location();
+ gfx::Point point = gfx::ToFlooredPoint(event.location());
views::View::ConvertPointToScreen(this, &point);
bool destroyed = false;
destroyed_ = &destroyed;
@@ -1038,7 +1038,7 @@ void TabStrip::MaybeStartDrag(
void TabStrip::ContinueDrag(views::View* view, const ui::LocatedEvent& event) {
if (drag_controller_.get() &&
drag_controller_->event_source() == EventSourceFromEvent(event)) {
- gfx::Point screen_location(event.location());
+ gfx::Point screen_location(gfx::ToFlooredPoint(event.location()));
views::View::ConvertPointToScreen(view, &screen_location);
drag_controller_->Drag(screen_location);
}
@@ -1500,7 +1500,7 @@ void TabStrip::OnGestureEvent(ui::GestureEvent* event) {
case ui::ET_GESTURE_LONG_TAP: {
EndDrag(END_DRAG_CANCEL);
- gfx::Point local_point = event->location();
+ gfx::Point local_point = gfx::ToFlooredPoint(event->location());
Tab* tab = FindTabForEvent(local_point);
if (tab) {
ConvertPointToScreen(this, &local_point);
@@ -2009,7 +2009,7 @@ void TabStrip::UpdateLayoutTypeFromMouseEvent(views::View* source,
last_mouse_move_time_ = base::TimeTicks();
SetResetToShrinkOnExit((event.flags() & ui::EF_FROM_TOUCH) == 0);
if (reset_to_shrink_on_exit_ && touch_layout_.get()) {
- gfx::Point tab_strip_point(event.location());
+ gfx::Point tab_strip_point(gfx::ToFlooredPoint(event.location()));
views::View::ConvertPointToTarget(source, this, &tab_strip_point);
Tab* tab = FindTabForEvent(tab_strip_point);
if (tab && touch_layout_->IsStacked(GetModelIndexOfTab(tab))) {
@@ -2024,7 +2024,7 @@ void TabStrip::UpdateLayoutTypeFromMouseEvent(views::View* source,
// Ash does not synthesize mouse events from touch events.
SetResetToShrinkOnExit(true);
#else
- gfx::Point location(event.location());
+ gfx::Point location(gfx::ToFlooredPoint(event.location()));
ConvertPointToTarget(source, this, &location);
if (location == last_mouse_move_location_)
return; // Ignore spurious moves.
@@ -2047,7 +2047,7 @@ void TabStrip::UpdateLayoutTypeFromMouseEvent(views::View* source,
}
case ui::ET_MOUSE_RELEASED: {
- gfx::Point location(event.location());
+ gfx::Point location(gfx::ToFlooredPoint(event.location()));
ConvertPointToTarget(source, this, &location);
last_mouse_move_location_ = location;
mouse_move_count_ = 0;

Powered by Google App Engine
This is Rietveld 408576698