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

Unified Diff: chrome/browser/ui/views/toolbar/browser_actions_container.cc

Issue 265713007: views: Update event-related API to use PointF/RectF instead of Point/Rect. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/toolbar/browser_actions_container.cc
diff --git a/chrome/browser/ui/views/toolbar/browser_actions_container.cc b/chrome/browser/ui/views/toolbar/browser_actions_container.cc
index 6e24af64c0a6ee3ba8fd40e6e67554b4291b3203..9ed85ec63049fe52b95162e45bff78a48d5a4d61 100644
--- a/chrome/browser/ui/views/toolbar/browser_actions_container.cc
+++ b/chrome/browser/ui/views/toolbar/browser_actions_container.cc
@@ -407,7 +407,7 @@ void BrowserActionsContainer::OnMenuButtonClicked(views::View* source,
}
void BrowserActionsContainer::WriteDragDataForView(View* sender,
- const gfx::Point& press_pt,
+ const gfx::PointF& press_pt,
OSExchangeData* data) {
DCHECK(data);
@@ -416,9 +416,11 @@ void BrowserActionsContainer::WriteDragDataForView(View* sender,
if (button == sender) {
// Set the dragging image for the icon.
gfx::ImageSkia badge(browser_action_views_[i]->GetIconWithBadge());
- drag_utils::SetDragImageOnDataObject(badge, button->size(),
- press_pt.OffsetFromOrigin(),
- data);
+ drag_utils::SetDragImageOnDataObject(
+ badge,
+ button->size(),
+ gfx::ToFlooredPoint(press_pt).OffsetFromOrigin(),
+ data);
// Fill in the remaining info.
BrowserActionDragData drag_data(
@@ -430,13 +432,13 @@ void BrowserActionsContainer::WriteDragDataForView(View* sender,
}
int BrowserActionsContainer::GetDragOperationsForView(View* sender,
- const gfx::Point& p) {
+ const gfx::PointF& p) {
return ui::DragDropTypes::DRAG_MOVE;
}
bool BrowserActionsContainer::CanStartDragForView(View* sender,
- const gfx::Point& press_pt,
- const gfx::Point& p) {
+ const gfx::PointF& press_pt,
+ const gfx::PointF& p) {
// We don't allow dragging while we're highlighting.
return !model_->is_highlighting();
}

Powered by Google App Engine
This is Rietveld 408576698