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

Unified Diff: ash/system/tray/tray_details_view.cc

Issue 210903003: Implemented system tray UI for new account management. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More comments addressed. Created 6 years, 9 months 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
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) {

Powered by Google App Engine
This is Rietveld 408576698