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

Unified Diff: ui/views/bubble/bubble_frame_view.cc

Issue 16084008: Restore Views dialog dragging and titlebar system menus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add a TestBubbleDelegateView hack for hit testing. Created 7 years, 7 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 | « ui/views/bubble/bubble_delegate.cc ('k') | ui/views/bubble/bubble_frame_view_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/bubble/bubble_frame_view.cc
diff --git a/ui/views/bubble/bubble_frame_view.cc b/ui/views/bubble/bubble_frame_view.cc
index a6e56ad9fd0fed55fa049b583cc745603023439a..ac9af32c1f31a2710ca2b958c83b5d96b74be9d9 100644
--- a/ui/views/bubble/bubble_frame_view.cc
+++ b/ui/views/bubble/bubble_frame_view.cc
@@ -94,14 +94,16 @@ int BubbleFrameView::NonClientHitTest(const gfx::Point& point) {
return HTNOWHERE;
if (close_->visible() && close_->GetMirroredBounds().Contains(point))
return HTCLOSE;
- if (!GetWidget()->widget_delegate()->CanResize())
- return GetWidget()->client_view()->NonClientHitTest(point);
-
const int size = bubble_border_->GetBorderThickness() + 4;
- const int hit = GetHTComponentForFrame(point, size, size, size, size, true);
- if (hit == HTNOWHERE && point.y() < title_->bounds().bottom())
+ const int sizes = GetHTComponentForFrame(point, size, size, size, size, true);
+ if (GetWidget()->widget_delegate()->CanResize() && sizes != HTNOWHERE)
+ return sizes;
+ // Allow dialogs with bubble frames to be dragged and show the system menu.
+ const int move = std::max(title_->bounds().bottom(), size + 4);
+ if (GetWidget()->widget_delegate()->AsDialogDelegate() != NULL &&
+ GetHTComponentForFrame(point, move, move, move, move, true) != HTNOWHERE)
return HTCAPTION;
- return hit;
+ return GetWidget()->client_view()->NonClientHitTest(point);
}
void BubbleFrameView::GetWindowMask(const gfx::Size& size,
« no previous file with comments | « ui/views/bubble/bubble_delegate.cc ('k') | ui/views/bubble/bubble_frame_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698