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

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

Issue 962453002: Update permission bubble anchor when omnibar is hidden (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix issue Created 5 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 55ce980289149c322219d60e35222009d4ee8614..68c35f2b2eb94acd048510abfc07ed808997aaac 100644
--- a/ui/views/bubble/bubble_delegate.cc
+++ b/ui/views/bubble/bubble_delegate.cc
@@ -96,7 +96,16 @@ BubbleDelegateView::~BubbleDelegateView() {
Widget* BubbleDelegateView::CreateBubble(BubbleDelegateView* bubble_delegate) {
bubble_delegate->Init();
// Get the latest anchor widget from the anchor view at bubble creation time.
- bubble_delegate->SetAnchorView(bubble_delegate->GetAnchorView());
+ views::View* anchor = bubble_delegate->GetAnchorView();
hcarmona 2015/02/28 00:24:53 Trybots hated this check. I'm removing it. Are th
groby-ooo-7-16 2015/02/28 00:26:22 This statement does not make sense to me. What che
hcarmona 2015/02/28 01:14:16 I added the DCHECK on line 105 to avoid having a b
+ BubbleBorder::Arrow arrow = bubble_delegate->arrow();
+
+ // Anchor should always be visible when it has an arrow to avoid accidentally
+ // showing a bubble with an arrow when the anchor is not visible.
+ // ex: Bubble is anchored to lock button in omnibar while in fullscreen.
+ DCHECK(arrow == BubbleBorder::NONE || arrow == BubbleBorder::FLOAT ||
groby-ooo-7-16 2015/02/28 00:25:12 Why verify this here, and not in the bubble where
hcarmona 2015/02/28 01:14:16 We can verify when drawing the bubble, but I imagi
+ anchor->IsDrawn());
+
+ bubble_delegate->SetAnchorView(anchor);
Widget* bubble_widget = CreateBubbleWidget(bubble_delegate);
#if defined(OS_WIN)

Powered by Google App Engine
This is Rietveld 408576698