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

Unified Diff: chrome/browser/ui/views/avatar_menu_bubble_view.cc

Issue 8909013: Patch AvatarMenuBubbleView crash; only SizeToContents if GetBubbleFrameView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Run OnAvatarMenuModelChanged on Init, not ctor. Created 9 years 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
« no previous file with comments | « chrome/browser/ui/views/avatar_menu_bubble_view.h ('k') | ui/views/bubble/bubble_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « chrome/browser/ui/views/avatar_menu_bubble_view.h ('k') | ui/views/bubble/bubble_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698