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

Unified Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 264303006: Support full-screen and single-profile avatar bubbles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Never enable the command on ChromeOS. Created 6 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
Index: chrome/browser/ui/views/frame/browser_view.cc
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 969869f6e969de143694489bafe5690c39fd5659..505532d439824ed66747a8df37029e7bba67a2fc 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -2369,7 +2369,8 @@ void BrowserView::ShowAvatarBubble(WebContents* web_contents,
views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin);
gfx::Rect bounds(origin, rect.size());
- AvatarMenuBubbleView::ShowBubble(this, views::BubbleBorder::TOP_RIGHT,
+ AvatarMenuBubbleView::ShowBubble(
+ this, views::BubbleBorder::TOP_RIGHT, views::BubbleBorder::PAINT_NORMAL,
views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, bounds, browser_.get());
}
@@ -2390,9 +2391,21 @@ void BrowserView::ShowAvatarBubbleFromAvatarButton(AvatarBubbleMode mode) {
views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, bounds, browser());
}
} else {
- AvatarMenuButton* button = frame_->GetAvatarMenuButton();
- if (button)
- button->ShowAvatarBubble();
+ views::BubbleBorder::Arrow arrow = views::BubbleBorder::TOP_RIGHT;
+ views::View* anchor_view = frame_->GetAvatarMenuButton();
+ if (!anchor_view)
+ anchor_view = toolbar_->app_menu();
+ else if (!frame_->GetAvatarMenuButton()->button_on_right())
+ arrow = views::BubbleBorder::TOP_LEFT;
+ gfx::Point origin;
+ views::View::ConvertPointToScreen(anchor_view, &origin);
+ gfx::Rect bounds(origin, anchor_view->size());
+ views::BubbleBorder::ArrowPaintType arrow_paint_type =
+ ShouldHideUIForFullscreen() ? views::BubbleBorder::PAINT_TRANSPARENT :
+ views::BubbleBorder::PAINT_NORMAL;
+ AvatarMenuBubbleView::ShowBubble(anchor_view, arrow, arrow_paint_type,
+ views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR, bounds, browser());
+ ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE);
}
}
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_cocoa.mm ('k') | chrome/browser/ui/views/profiles/avatar_menu_bubble_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698