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

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

Issue 9546001: Support detaching/attaching panels via inter-strip drags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix per feedback Created 8 years, 10 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/panels/panel_browser_frame_view.cc
diff --git a/chrome/browser/ui/panels/panel_browser_frame_view.cc b/chrome/browser/ui/panels/panel_browser_frame_view.cc
index e5c7c50b36e3b504166c9cd526680013fd7a3509..f932c64a51890725c2cc19f5928d4078551f83aa 100644
--- a/chrome/browser/ui/panels/panel_browser_frame_view.cc
+++ b/chrome/browser/ui/panels/panel_browser_frame_view.cc
@@ -594,15 +594,25 @@ void PanelBrowserFrameView::GetAccessibleState(ui::AccessibleViewState* state) {
}
bool PanelBrowserFrameView::OnMousePressed(const views::MouseEvent& event) {
+ // |event.location| is in the view's coordinate system. Convert it to the
+ // screen coordinate system.
+ gfx::Point mouse_location = event.location();
+ views::View::ConvertPointToScreen(this, &mouse_location);
+
if (event.IsOnlyLeftMouseButton() &&
- panel_browser_view_->OnTitlebarMousePressed(event.location())) {
+ panel_browser_view_->OnTitlebarMousePressed(mouse_location)) {
return true;
}
return BrowserNonClientFrameView::OnMousePressed(event);
}
bool PanelBrowserFrameView::OnMouseDragged(const views::MouseEvent& event) {
- if (panel_browser_view_->OnTitlebarMouseDragged(event.location()))
+ // |event.location| is in the view's coordinate system. Convert it to the
+ // screen coordinate system.
+ gfx::Point mouse_location = event.location();
+ views::View::ConvertPointToScreen(this, &mouse_location);
+
+ if (panel_browser_view_->OnTitlebarMouseDragged(mouse_location))
return true;
return BrowserNonClientFrameView::OnMouseDragged(event);
}

Powered by Google App Engine
This is Rietveld 408576698