| OLD | NEW |
| 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 2718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2729 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | 2729 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
| 2730 return view; | 2730 return view; |
| 2731 } | 2731 } |
| 2732 | 2732 |
| 2733 void BrowserView::ShowAvatarBubble(WebContents* web_contents, | 2733 void BrowserView::ShowAvatarBubble(WebContents* web_contents, |
| 2734 const gfx::Rect& rect) { | 2734 const gfx::Rect& rect) { |
| 2735 gfx::Point origin(rect.origin()); | 2735 gfx::Point origin(rect.origin()); |
| 2736 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); | 2736 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); |
| 2737 gfx::Rect bounds(origin, rect.size()); | 2737 gfx::Rect bounds(origin, rect.size()); |
| 2738 | 2738 |
| 2739 AvatarMenuBubbleView* bubble = new AvatarMenuBubbleView(this, | 2739 AvatarMenuBubbleView::ShowBubble(this, views::BubbleBorder::TOP_RIGHT, |
| 2740 views::BubbleBorder::TOP_RIGHT, bounds, browser_.get()); | 2740 views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, bounds, browser_.get()); |
| 2741 views::BubbleDelegateView::CreateBubble(bubble); | |
| 2742 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | |
| 2743 bubble->Show(); | |
| 2744 } | 2741 } |
| 2745 | 2742 |
| 2746 void BrowserView::ShowAvatarBubbleFromAvatarButton() { | 2743 void BrowserView::ShowAvatarBubbleFromAvatarButton() { |
| 2747 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); | 2744 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); |
| 2748 if (button) | 2745 if (button) |
| 2749 button->ShowAvatarBubble(); | 2746 button->ShowAvatarBubble(); |
| 2750 } | 2747 } |
| 2751 | 2748 |
| 2752 void BrowserView::ShowPasswordGenerationBubble( | 2749 void BrowserView::ShowPasswordGenerationBubble( |
| 2753 const gfx::Rect& rect, | 2750 const gfx::Rect& rect, |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2812 modal_browser->window()->Activate(); | 2809 modal_browser->window()->Activate(); |
| 2813 } | 2810 } |
| 2814 | 2811 |
| 2815 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); | 2812 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); |
| 2816 } | 2813 } |
| 2817 | 2814 |
| 2818 void BrowserView::MaybeStackBookmarkBarAtTop() { | 2815 void BrowserView::MaybeStackBookmarkBarAtTop() { |
| 2819 if (bookmark_bar_view_.get()) | 2816 if (bookmark_bar_view_.get()) |
| 2820 bookmark_bar_view_->MaybeStackAtTop(); | 2817 bookmark_bar_view_->MaybeStackAtTop(); |
| 2821 } | 2818 } |
| OLD | NEW |