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

Side by Side Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 11646008: Close avatar bubble when avatar button is clicked a second time (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix build Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/views/avatar_menu_button_browsertest.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/frame/browser_view.h" 5 #include "chrome/browser/ui/views/frame/browser_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 2720 matching lines...) Expand 10 before | Expand all | Expand 10 after
2731 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); 2731 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
2732 return view; 2732 return view;
2733 } 2733 }
2734 2734
2735 void BrowserView::ShowAvatarBubble(WebContents* web_contents, 2735 void BrowserView::ShowAvatarBubble(WebContents* web_contents,
2736 const gfx::Rect& rect) { 2736 const gfx::Rect& rect) {
2737 gfx::Point origin(rect.origin()); 2737 gfx::Point origin(rect.origin());
2738 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); 2738 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin);
2739 gfx::Rect bounds(origin, rect.size()); 2739 gfx::Rect bounds(origin, rect.size());
2740 2740
2741 AvatarMenuBubbleView* bubble = new AvatarMenuBubbleView(this, 2741 AvatarMenuBubbleView::ShowBubble(this, views::BubbleBorder::TOP_RIGHT,
2742 views::BubbleBorder::TOP_RIGHT, bounds, browser_.get()); 2742 views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, bounds, browser_.get());
2743 views::BubbleDelegateView::CreateBubble(bubble);
2744 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE);
2745 bubble->Show();
2746 } 2743 }
2747 2744
2748 void BrowserView::ShowAvatarBubbleFromAvatarButton() { 2745 void BrowserView::ShowAvatarBubbleFromAvatarButton() {
2749 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); 2746 AvatarMenuButton* button = frame_->GetAvatarMenuButton();
2750 if (button) 2747 if (button)
2751 button->ShowAvatarBubble(); 2748 button->ShowAvatarBubble();
2752 } 2749 }
2753 2750
2754 void BrowserView::ShowPasswordGenerationBubble( 2751 void BrowserView::ShowPasswordGenerationBubble(
2755 const gfx::Rect& rect, 2752 const gfx::Rect& rect,
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
2814 modal_browser->window()->Activate(); 2811 modal_browser->window()->Activate();
2815 } 2812 }
2816 2813
2817 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); 2814 AppModalDialogQueue::GetInstance()->ActivateModalDialog();
2818 } 2815 }
2819 2816
2820 void BrowserView::MaybeStackBookmarkBarAtTop() { 2817 void BrowserView::MaybeStackBookmarkBarAtTop() {
2821 if (bookmark_bar_view_.get()) 2818 if (bookmark_bar_view_.get())
2822 bookmark_bar_view_->MaybeStackAtTop(); 2819 bookmark_bar_view_->MaybeStackAtTop();
2823 } 2820 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/avatar_menu_button_browsertest.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698