| 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 2720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |