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

Unified Diff: chrome/browser/ui/panels/panel_drag_controller.cc

Issue 9616037: Change panel drag related methods to use mouse location in screen coordinates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch to reland Created 8 years, 9 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
« no previous file with comments | « chrome/browser/ui/panels/panel_drag_controller.h ('k') | chrome/browser/ui/panels/panel_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/panels/panel_drag_controller.cc
diff --git a/chrome/browser/ui/panels/panel_drag_controller.cc b/chrome/browser/ui/panels/panel_drag_controller.cc
index 2a21cd28b7ffdf9af6b959ce845b07a30c172a51..7cd099053250f7f231d2d5a9c357245f66f0f825 100644
--- a/chrome/browser/ui/panels/panel_drag_controller.cc
+++ b/chrome/browser/ui/panels/panel_drag_controller.cc
@@ -15,20 +15,28 @@ PanelDragController::PanelDragController()
PanelDragController::~PanelDragController() {
}
-void PanelDragController::StartDragging(Panel* panel) {
+void PanelDragController::StartDragging(Panel* panel,
+ const gfx::Point& mouse_location) {
DCHECK(!dragging_panel_);
DCHECK(panel->draggable());
+ last_mouse_location_ = mouse_location;
+
dragging_panel_ = panel;
dragging_panel_original_position_ = panel->GetBounds().origin();
dragging_panel_->panel_strip()->StartDraggingPanel(panel);
}
-void PanelDragController::Drag(int delta_x, int delta_y) {
+void PanelDragController::Drag(const gfx::Point& mouse_location) {
DCHECK(dragging_panel_);
- dragging_panel_->panel_strip()->DragPanel(dragging_panel_, delta_x, delta_y);
+ dragging_panel_->panel_strip()->DragPanel(
+ dragging_panel_,
+ mouse_location.x() - last_mouse_location_.x(),
+ mouse_location.y() - last_mouse_location_.y());
+
+ last_mouse_location_ = mouse_location;
}
void PanelDragController::EndDragging(bool cancelled) {
« no previous file with comments | « chrome/browser/ui/panels/panel_drag_controller.h ('k') | chrome/browser/ui/panels/panel_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698