From 2258e8243b5c7e216f2740d5e95256f521c5f212 Mon Sep 17 00:00:00 2001 From: "gspencer@chromium.org" Date: Wed, 18 Jul 2012 19:06:22 +0000 Subject: Merge 146482 - ash: Close bubble view if CreateItemViews fails. SystemTrayBubble::CreateItemViews may fail if the SystemTrayItem's view creation call returns NULL. For example, TrayDrive::CreateDetailedView() returns NULL when the current GDrive operation list is empty. BUG=133420 TEST=CQ, lumpy Review URL: https://chromiumcodereview.appspot.com/10689182 TBR=hshi@chromium.org Review URL: https://chromiumcodereview.appspot.com/10796017 git-svn-id: svn://svn.chromium.org/chrome/branches/1180/src@147284 0039d316-1c4b-4281-b951-d872f2087c98 --- ash/system/tray/system_tray_bubble.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ash/system/tray/system_tray_bubble.cc b/ash/system/tray/system_tray_bubble.cc index a934a7b..eeac33b 100644 --- a/ash/system/tray/system_tray_bubble.cc +++ b/ash/system/tray/system_tray_bubble.cc @@ -255,6 +255,13 @@ void SystemTrayBubble::UpdateView( items_ = items; bubble_type_ = bubble_type; CreateItemViews(Shell::GetInstance()->tray_delegate()->GetUserLoginStatus()); + + // Close bubble view if we failed to create the item view. + if (!bubble_view_->has_children()) { + Close(); + return; + } + bubble_widget_->GetContentsView()->Layout(); // Make sure that the bubble is large enough for the default view. if (bubble_type_ == BUBBLE_TYPE_DEFAULT) { -- cgit v1.1