| 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 1d8e3d8d30b84b1d1f3b34b9d9e7411751859ef6..15bf1791aa696fc7af63474a22d5f4123a658f82 100644
|
| --- a/ash/system/tray/tray_details_view.cc
|
| +++ b/ash/system/tray/tray_details_view.cc
|
| @@ -127,26 +127,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) {
|
|
|