Index: ash/system/tray/tray_details_view.cc |
diff --git a/ash/system/tray/tray_details_view.cc b/ash/system/tray/tray_details_view.cc |
index 1e439a3f0671e8bc3813fc23ed4fdfa1805e9919..6a137f1cc4e3ae816a527d56358fcf4d31c57656 100644 |
--- a/ash/system/tray/tray_details_view.cc |
+++ b/ash/system/tray/tray_details_view.cc |
@@ -126,26 +126,31 @@ void TrayDetailsView::TransitionToDefaultView() { |
} |
void TrayDetailsView::Layout() { |
- if (!scroller_ || !footer_ || bounds().IsEmpty()) { |
+ if (bounds().IsEmpty()) { |
views::View::Layout(); |
return; |
} |
- scroller_->set_fixed_size(gfx::Size()); |
- gfx::Size size = GetPreferredSize(); |
+ if (scroller_) { |
+ scroller_->set_fixed_size(gfx::Size()); |
+ gfx::Size size = GetPreferredSize(); |
- // Set the scroller to fill the space above the bottom row, so that the |
- // bottom row of the detailed view will always stay just above the footer. |
- gfx::Size scroller_size = scroll_content_->GetPreferredSize(); |
- scroller_->set_fixed_size(gfx::Size( |
- width() + scroller_->GetScrollBarWidth(), |
- scroller_size.height() - (size.height() - height()))); |
+ // Set the scroller to fill the space above the bottom row, so that the |
+ // bottom row of the detailed view will always stay just above the footer. |
+ gfx::Size scroller_size = scroll_content_->GetPreferredSize(); |
+ scroller_->set_fixed_size( |
+ gfx::Size(width() + scroller_->GetScrollBarWidth(), |
+ scroller_size.height() - (size.height() - height()))); |
+ } |
views::View::Layout(); |
- // Always make sure the footer element is bottom aligned. |
- gfx::Rect fbounds = footer_->bounds(); |
- fbounds.set_y(height() - footer_->height()); |
- footer_->SetBoundsRect(fbounds); |
+ |
+ if (footer_) { |
+ // Always make sure the footer element is bottom aligned. |
+ gfx::Rect fbounds = footer_->bounds(); |
+ fbounds.set_y(height() - footer_->height()); |
+ footer_->SetBoundsRect(fbounds); |
+ } |
} |
void TrayDetailsView::OnPaintBorder(gfx::Canvas* canvas) { |