Commit 13e3c1f7 authored by sadrul@chromium.org's avatar sadrul@chromium.org

ash: Fix setting the tray-widget size when tray-view for date changes.

BUG=123657
TEST=none

Review URL: https://chromiumcodereview.appspot.com/10278006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134807 0039d316-1c4b-4281-b951-d872f2087c98
parent 482c6438
......@@ -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();
}
......
......@@ -36,6 +36,7 @@ class BaseDateTimeView : public ActionableView {
virtual void UpdateTextInternal(const base::Time& now) = 0;
// Overridden from views::View.
virtual void ChildPreferredSizeChanged(views::View* child) OVERRIDE;
virtual void OnLocaleChanged() OVERRIDE;
base::OneShotTimer<BaseDateTimeView> timer_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment