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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_popup_contents_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/omnibox/omnibox_popup_contents_view.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
index 7d1af393ef7f13d59a7466b9f6447904dac86f50..eb5334cdd4a6ca337438e722f2d2d72fb397ac11 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc
@@ -334,12 +334,14 @@ void OmniboxPopupContentsView::OnMouseCaptureLost() {
void OmniboxPopupContentsView::OnMouseMoved(
const ui::MouseEvent& event) {
- model_->SetHoveredLine(GetIndexForPoint(event.location()));
+ model_->SetHoveredLine(
+ GetIndexForPoint(gfx::ToFlooredPoint(event.location())));
}
void OmniboxPopupContentsView::OnMouseEntered(
const ui::MouseEvent& event) {
- model_->SetHoveredLine(GetIndexForPoint(event.location()));
+ model_->SetHoveredLine(
+ GetIndexForPoint(gfx::ToFlooredPoint(event.location())));
}
void OmniboxPopupContentsView::OnMouseExited(
@@ -480,7 +482,7 @@ size_t OmniboxPopupContentsView::GetIndexForPoint(
void OmniboxPopupContentsView::UpdateLineEvent(
const ui::LocatedEvent& event,
bool should_set_selected_line) {
- size_t index = GetIndexForPoint(event.location());
+ size_t index = GetIndexForPoint(gfx::ToFlooredPoint(event.location()));
model_->SetHoveredLine(index);
if (HasMatchAt(index) && should_set_selected_line)
model_->SetSelectedLine(index, false, false);
@@ -489,7 +491,7 @@ void OmniboxPopupContentsView::UpdateLineEvent(
void OmniboxPopupContentsView::OpenSelectedLine(
const ui::LocatedEvent& event,
WindowOpenDisposition disposition) {
- size_t index = GetIndexForPoint(event.location());
+ size_t index = GetIndexForPoint(gfx::ToFlooredPoint(event.location()));
if (!HasMatchAt(index))
return;
omnibox_view_->OpenMatch(model_->result().match_at(index), disposition,

Powered by Google App Engine
This is Rietveld 408576698