Index: ash/system/date/date_view.cc |
diff --git a/ash/system/date/date_view.cc b/ash/system/date/date_view.cc |
index 6c614bb5787fc696c0f80201678040102a516f3b..f303f73a37c383c77e9f948ceead97c2edb9ebfb 100644 |
--- a/ash/system/date/date_view.cc |
+++ b/ash/system/date/date_view.cc |
@@ -62,11 +62,6 @@ void BaseDateTimeView::UpdateText() { |
base::Time now = base::Time::Now(); |
gfx::Size old_size = GetPreferredSize(); |
UpdateTextInternal(now); |
- if (GetWidget() && GetPreferredSize() != old_size) { |
- // Forcing the widget to the new size is sufficient. The positioning is |
- // taken care of by the layout manager (ShelfLayoutManager). |
- GetWidget()->SetSize(GetPreferredSize()); |
- } |
SchedulePaint(); |
// Try to set the timer to go off at the next change of the minute. We don't |
@@ -94,6 +89,12 @@ void BaseDateTimeView::UpdateText() { |
BaseDateTimeView::BaseDateTimeView() { |
} |
+void BaseDateTimeView::ChildPreferredSizeChanged(views::View* child) { |
+ views::View::PreferredSizeChanged(); |
+ if (GetWidget()) |
+ GetWidget()->SetSize(GetWidget()->GetContentsView()->GetPreferredSize()); |
+} |
+ |
void BaseDateTimeView::OnLocaleChanged() { |
UpdateText(); |
} |