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

Unified Diff: chrome/browser/ui/views/download/download_item_view.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/download/download_item_view.cc
diff --git a/chrome/browser/ui/views/download/download_item_view.cc b/chrome/browser/ui/views/download/download_item_view.cc
index a1b609801d36eaadf0b9a1762e2ffdbc1d4f9943..97c7926d10ee1d73599942e11ed818b22bc67b9f 100644
--- a/chrome/browser/ui/views/download/download_item_view.cc
+++ b/chrome/browser/ui/views/download/download_item_view.cc
@@ -414,7 +414,7 @@ bool DownloadItemView::OnMouseDragged(const ui::MouseEvent& event) {
if (!starting_drag_) {
starting_drag_ = true;
- drag_start_point_ = event.location();
+ drag_start_point_ = gfx::ToFlooredPoint(event.location());
}
if (dragging_) {
if (download()->GetState() == DownloadItem::COMPLETE) {
@@ -425,7 +425,8 @@ bool DownloadItemView::OnMouseDragged(const ui::MouseEvent& event) {
DragDownloadItem(
download(), icon, widget ? widget->GetNativeView() : NULL);
}
- } else if (ExceededDragThreshold(event.location() - drag_start_point_)) {
+ } else if (ExceededDragThreshold(gfx::ToFlooredPoint(event.location()) -
+ drag_start_point_)) {
dragging_ = true;
}
return true;
@@ -1031,7 +1032,8 @@ void DownloadItemView::HandlePressEvent(const ui::LocatedEvent& event,
// so that the positioning of the context menu will be similar to a
// keyboard invocation. I.e. we want the menu to always be positioned
// next to the drop down button instead of the next to the pointer.
- ShowContextMenuImpl(event.location(), ui::MENU_SOURCE_KEYBOARD);
+ ShowContextMenuImpl(gfx::ToFlooredPoint(event.location()),
+ ui::MENU_SOURCE_KEYBOARD);
// Once called, it is possible that *this was deleted (e.g.: due to
// invoking the 'Discard' action.)
} else if (!IsShowingWarningDialog()) {

Powered by Google App Engine
This is Rietveld 408576698