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

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

Issue 16361009: Do not allow Views new-dialog-style windows to be resized. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make DialogTest.HitTest more flexible. Created 7 years, 6 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: 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 050a408f5900179b6b0629519926696f2c530067..cb57953da11937beaad23d855ae54d66cdc43a70 100644
--- a/ui/views/bubble/bubble_frame_view.cc
+++ b/ui/views/bubble/bubble_frame_view.cc
@@ -94,14 +94,18 @@ 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())
- return HTCAPTION;
- return hit;
+
+ // Allow dialogs to show the system menu and be dragged.
+ if (GetWidget()->widget_delegate()->AsDialogDelegate()) {
+ gfx::Rect sys_rect(0, 0, title_->x(), title_->y());
+ sys_rect.set_origin(gfx::Point(GetMirroredXForRect(sys_rect), 0));
+ if (sys_rect.Contains(point))
+ return HTSYSMENU;
+ if (point.y() < title_->bounds().bottom())
+ return HTCAPTION;
+ }
+
+ return GetWidget()->client_view()->NonClientHitTest(point);
}
void BubbleFrameView::GetWindowMask(const gfx::Size& size,
« no previous file with comments | « chrome/browser/ui/views/create_application_shortcut_view.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