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

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

Issue 152843004: Move BookmarkBubble with anchor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/bubble/bubble_delegate.cc
diff --git a/ui/views/bubble/bubble_delegate.cc b/ui/views/bubble/bubble_delegate.cc
index 53ff9e69b7e56f075dd900172d24f536cc9b95bc..972743dc964fc8bebdda8bd67a539749020fd36c 100644
--- a/ui/views/bubble/bubble_delegate.cc
+++ b/ui/views/bubble/bubble_delegate.cc
@@ -176,10 +176,16 @@ void BubbleDelegateView::OnWidgetActivationChanged(Widget* widget,
void BubbleDelegateView::OnWidgetBoundsChanged(Widget* widget,
const gfx::Rect& new_bounds) {
if (anchor_widget() == widget) {
- if (move_with_anchor())
+ if (move_with_anchor()) {
SizeToContents();
- else
- GetWidget()->Close();
+ } else {
+ // Do not close if the widget gets shrinked vertically without move.
msw 2014/02/13 00:32:48 This seems odd, and I don't think this is the righ
oshima 2014/02/13 01:28:29 You're right that anchor position may change even
msw 2014/02/13 01:38:07 I don't see a reason offhand why the bookmark bubb
+ gfx::Rect bounds = widget->GetWindowBoundsInScreen();
+ if (bounds.origin() != new_bounds.origin() ||
+ bounds.width() != new_bounds.width()) {
+ GetWidget()->Close();
+ }
+ }
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698