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

Unified Diff: ash/system/date/date_view.cc

Issue 10278006: ash: Fix setting the tray-widget size when tray-view for date changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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
« no previous file with comments | « ash/system/date/date_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « ash/system/date/date_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698