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

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

Issue 15667004: Add resize support for Views new style dialogs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove incorrect DialogDelegate::CanResize overrride. 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_frame_view.h ('k') | ui/views/window/dialog_delegate.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 e6375dcaf61599a78701c97cd69ae70bfd369b8e..69be4228b56c4685a9a1b6f1f60013929e530072 100644
--- a/ui/views/bubble/bubble_frame_view.cc
+++ b/ui/views/bubble/bubble_frame_view.cc
@@ -14,6 +14,7 @@
#include "ui/views/bubble/bubble_border.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/widget/widget.h"
+#include "ui/views/widget/widget_delegate.h"
#include "ui/views/window/client_view.h"
namespace {
@@ -53,8 +54,7 @@ BubbleFrameView::BubbleFrameView(const gfx::Insets& content_margins)
content_margins_(content_margins),
title_(NULL),
close_(NULL),
- titlebar_extra_view_(NULL),
- can_drag_(false) {
+ titlebar_extra_view_(NULL) {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
title_ = new Label(string16(), rb.GetFont(ui::ResourceBundle::MediumFont));
title_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
@@ -89,11 +89,18 @@ gfx::Rect BubbleFrameView::GetWindowBoundsForClientBounds(
}
int BubbleFrameView::NonClientHitTest(const gfx::Point& point) {
+ if (!bounds().Contains(point))
+ return HTNOWHERE;
if (close_->visible() && close_->GetMirroredBounds().Contains(point))
return HTCLOSE;
- if (can_drag_ && point.y() < GetInsets().top())
+ 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 GetWidget()->client_view()->NonClientHitTest(point);
+ return hit;
}
void BubbleFrameView::GetWindowMask(const gfx::Size& size,
« no previous file with comments | « ui/views/bubble/bubble_frame_view.h ('k') | ui/views/window/dialog_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698