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

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

Issue 1637383003: MacViews: Fix views_unittests BubbleDelegateTest.CloseReasons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix type of params.child (bool, not ptr). Created 4 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: ui/views/bubble/bubble_delegate.cc
diff --git a/ui/views/bubble/bubble_delegate.cc b/ui/views/bubble/bubble_delegate.cc
index a18c08888d20d3a2d1154053073c25be19b34327..250ac499f163c3bfab2e2690b6c44da15144eff0 100644
--- a/ui/views/bubble/bubble_delegate.cc
+++ b/ui/views/bubble/bubble_delegate.cc
@@ -38,6 +38,7 @@ Widget* CreateBubbleWidget(BubbleDelegateView* bubble) {
bubble_params.parent = bubble->anchor_widget()->GetNativeView();
bubble_params.activatable = bubble->CanActivate() ?
Widget::InitParams::ACTIVATABLE_YES : Widget::InitParams::ACTIVATABLE_NO;
+ bubble_params.child = true;
bubble->OnBeforeBubbleWidgetInit(&bubble_params, bubble_widget);
bubble_widget->Init(bubble_params);
if (bubble_params.parent)
@@ -177,7 +178,9 @@ void BubbleDelegateView::OnWidgetVisibilityChanged(Widget* widget,
void BubbleDelegateView::OnWidgetActivationChanged(Widget* widget,
bool active) {
- if (close_on_deactivate() && widget == GetWidget() && !active) {
+ // Only close the widget if it's been shown in the first place.
tapted 2016/03/01 02:42:39 Was this necessary to get the test to pass? Otherw
Patti Lor 2016/03/01 06:54:48 Have reverted this. The child = true change preven
+ if (close_on_deactivate() && widget == GetWidget() && !active &&
+ GetWidget()->IsActive()) {
if (close_reason_ == CloseReason::UNKNOWN)
close_reason_ = CloseReason::DEACTIVATION;
GetWidget()->Close();
« no previous file with comments | « no previous file | ui/views/bubble/bubble_delegate_unittest.cc » ('j') | ui/views/bubble/bubble_delegate_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698