Index: chrome/browser/ui/views/avatar_menu_bubble_view.cc |
diff --git a/chrome/browser/ui/views/avatar_menu_bubble_view.cc b/chrome/browser/ui/views/avatar_menu_bubble_view.cc |
index 594827121fa0838491d88b244e4655dc83252f6e..6e96271d72aae8442f2f54a0db0fbf3399012c51 100644 |
--- a/chrome/browser/ui/views/avatar_menu_bubble_view.cc |
+++ b/chrome/browser/ui/views/avatar_menu_bubble_view.cc |
@@ -138,7 +138,6 @@ bool ProfileImageView::HitTest(const gfx::Point& l) const { |
return false; |
} |
Peter Kasting
2011/12/14 22:41:56
Nit: Don't remove this.
(Besides, you didn't remo
|
- |
// ProfileItemView ------------------------------------------------------------ |
// Control that shows information about a single profile. |
@@ -432,16 +431,6 @@ bool AvatarMenuBubbleView::AcceleratorPressed( |
return true; |
} |
-void AvatarMenuBubbleView::ViewHierarchyChanged(bool is_add, |
- views::View* parent, |
- views::View* child) { |
- // Build the menu for the first time. |
- if (!add_profile_link_ && is_add && child == this) |
- OnAvatarMenuModelChanged(avatar_menu_model_.get()); |
- |
- views::BubbleDelegateView::ViewHierarchyChanged(is_add, parent, child); |
-} |
- |
void AvatarMenuBubbleView::ButtonPressed(views::Button* sender, |
const views::Event& event) { |
for (size_t i = 0; i < item_views_.size(); ++i) { |
@@ -475,6 +464,8 @@ gfx::Rect AvatarMenuBubbleView::GetAnchorRect() { |
} |
void AvatarMenuBubbleView::Init() { |
+ // Build the menu for the first time. |
+ OnAvatarMenuModelChanged(avatar_menu_model_.get()); |
AddAccelerator(ui::Accelerator(ui::VKEY_DOWN, 0)); |
AddAccelerator(ui::Accelerator(ui::VKEY_UP, 0)); |
} |
@@ -510,5 +501,6 @@ void AvatarMenuBubbleView::OnAvatarMenuModelChanged( |
// If the bubble has already been shown then resize and reposition the bubble. |
Layout(); |
- SizeToContents(); |
+ if (GetBubbleFrameView()) |
+ SizeToContents(); |
} |