Index: chrome/browser/ui/panels/panel_browser_view.cc |
diff --git a/chrome/browser/ui/panels/panel_browser_view.cc b/chrome/browser/ui/panels/panel_browser_view.cc |
index 9873a24b7b06df08190efd61f66d09695053000d..92daaa3b372e838fc27f89b9780dc515e1461371 100644 |
--- a/chrome/browser/ui/panels/panel_browser_view.cc |
+++ b/chrome/browser/ui/panels/panel_browser_view.cc |
@@ -427,19 +427,17 @@ PanelBrowserFrameView* PanelBrowserView::GetFrameView() const { |
return static_cast<PanelBrowserFrameView*>(frame()->GetFrameView()); |
} |
-bool PanelBrowserView::OnTitlebarMousePressed(const gfx::Point& location) { |
- // |location| is in the view's coordinate system. Convert it to the screen |
- // coordinate system. |
- mouse_location_ = location; |
- views::View::ConvertPointToScreen(this, &mouse_location_); |
- |
+bool PanelBrowserView::OnTitlebarMousePressed( |
+ const gfx::Point& mouse_location) { |
mouse_pressed_ = true; |
mouse_pressed_time_ = base::TimeTicks::Now(); |
mouse_dragging_state_ = NO_DRAGGING; |
+ mouse_location_ = mouse_location; |
return true; |
} |
-bool PanelBrowserView::OnTitlebarMouseDragged(const gfx::Point& location) { |
+bool PanelBrowserView::OnTitlebarMouseDragged( |
+ const gfx::Point& mouse_location) { |
if (!mouse_pressed_) |
return false; |
@@ -447,11 +445,7 @@ bool PanelBrowserView::OnTitlebarMouseDragged(const gfx::Point& location) { |
return true; |
gfx::Point last_mouse_location = mouse_location_; |
- |
- // |location| is in the view's coordinate system. Convert it to the screen |
- // coordinate system. |
- mouse_location_ = location; |
- views::View::ConvertPointToScreen(this, &mouse_location_); |
+ mouse_location_ = mouse_location; |
int delta_x = mouse_location_.x() - last_mouse_location.x(); |
int delta_y = mouse_location_.y() - last_mouse_location.y(); |
@@ -462,11 +456,11 @@ bool PanelBrowserView::OnTitlebarMouseDragged(const gfx::Point& location) { |
old_focused_view_ = GetFocusManager()->GetFocusedView(); |
GetFocusManager()->SetFocusedView(GetFrameView()); |
- panel_->manager()->StartDragging(panel_.get()); |
+ panel_->manager()->StartDragging(panel_.get(), last_mouse_location); |
mouse_dragging_state_ = DRAGGING_STARTED; |
} |
if (mouse_dragging_state_ == DRAGGING_STARTED) |
- panel_->manager()->Drag(delta_x, delta_y); |
+ panel_->manager()->Drag(mouse_location_); |
return true; |
} |
@@ -550,9 +544,9 @@ class NativePanelTestingWin : public NativePanelTesting { |
private: |
virtual void PressLeftMouseButtonTitlebar( |
- const gfx::Point& point) OVERRIDE; |
+ const gfx::Point& mouse_location) OVERRIDE; |
virtual void ReleaseMouseButtonTitlebar() OVERRIDE; |
- virtual void DragTitlebar(int delta_x, int delta_y) OVERRIDE; |
+ virtual void DragTitlebar(const gfx::Point& mouse_location) OVERRIDE; |
virtual void CancelDragTitlebar() OVERRIDE; |
virtual void FinishDragTitlebar() OVERRIDE; |
virtual bool VerifyDrawingAttention() const OVERRIDE; |
@@ -577,23 +571,16 @@ NativePanelTestingWin::NativePanelTestingWin( |
} |
void NativePanelTestingWin::PressLeftMouseButtonTitlebar( |
- const gfx::Point& point) { |
- panel_browser_view_->OnTitlebarMousePressed(point); |
+ const gfx::Point& mouse_location) { |
+ panel_browser_view_->OnTitlebarMousePressed(mouse_location); |
} |
void NativePanelTestingWin::ReleaseMouseButtonTitlebar() { |
panel_browser_view_->OnTitlebarMouseReleased(); |
} |
-void NativePanelTestingWin::DragTitlebar(int delta_x, int delta_y) { |
- gfx::Point new_mouse_location = panel_browser_view_->mouse_location_; |
- new_mouse_location.Offset(delta_x, delta_y); |
- |
- // Convert from the screen coordinate system to the view's coordinate system |
- // since OnTitlebarMouseDragged takes the point in the latter. |
- views::View::ConvertPointToView(NULL, panel_browser_view_, |
- &new_mouse_location); |
- panel_browser_view_->OnTitlebarMouseDragged(new_mouse_location); |
+void NativePanelTestingWin::DragTitlebar(const gfx::Point& mouse_location) { |
+ panel_browser_view_->OnTitlebarMouseDragged(mouse_location); |
} |
void NativePanelTestingWin::CancelDragTitlebar() { |