diff options
| author | gspencer@chromium.org <gspencer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-18 19:06:22 +0000 |
|---|---|---|
| committer | gspencer@chromium.org <gspencer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-18 19:06:22 +0000 |
| commit | 2258e8243b5c7e216f2740d5e95256f521c5f212 (patch) | |
| tree | 1faa6b90a3e9cd57f2bceadb1804dc0aac191bcb | |
| parent | 179f74170805fab170e66682577ba2d0ba7fd510 (diff) | |
| download | chromium_src-2258e8243b5c7e216f2740d5e95256f521c5f212.zip chromium_src-2258e8243b5c7e216f2740d5e95256f521c5f212.tar.gz chromium_src-2258e8243b5c7e216f2740d5e95256f521c5f212.tar.bz2 | |
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
| -rw-r--r-- | ash/system/tray/system_tray_bubble.cc | 7 |
1 files changed, 7 insertions, 0 deletions
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) { |
