OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/system/date/date_view.h" | 5 #include "ash/system/date/date_view.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/system/tray/system_tray_delegate.h" | 8 #include "ash/system/tray/system_tray_delegate.h" |
9 #include "ash/system/tray/tray_constants.h" | 9 #include "ash/system/tray/tray_constants.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // called just a teeny bit early, then it will skip the next minute. | 86 // called just a teeny bit early, then it will skip the next minute. |
87 seconds_left += kTimerSlopSeconds; | 87 seconds_left += kTimerSlopSeconds; |
88 | 88 |
89 timer_.Stop(); | 89 timer_.Stop(); |
90 timer_.Start( | 90 timer_.Start( |
91 FROM_HERE, base::TimeDelta::FromSeconds(seconds_left), | 91 FROM_HERE, base::TimeDelta::FromSeconds(seconds_left), |
92 this, &BaseDateTimeView::UpdateText); | 92 this, &BaseDateTimeView::UpdateText); |
93 } | 93 } |
94 | 94 |
95 void BaseDateTimeView::ChildPreferredSizeChanged(views::View* child) { | 95 void BaseDateTimeView::ChildPreferredSizeChanged(views::View* child) { |
96 views::View::PreferredSizeChanged(); | 96 PreferredSizeChanged(); |
97 if (GetWidget()) | |
98 GetWidget()->SetSize(GetWidget()->GetContentsView()->GetPreferredSize()); | |
99 } | 97 } |
100 | 98 |
101 void BaseDateTimeView::OnLocaleChanged() { | 99 void BaseDateTimeView::OnLocaleChanged() { |
102 UpdateText(); | 100 UpdateText(); |
103 } | 101 } |
104 | 102 |
105 DateView::DateView() : actionable_(false) { | 103 DateView::DateView() : actionable_(false) { |
106 SetLayoutManager( | 104 SetLayoutManager( |
107 new views::BoxLayout( | 105 new views::BoxLayout( |
108 views::BoxLayout::kVertical, 0, 0, kTrayPopupTextSpacingVertical)); | 106 views::BoxLayout::kVertical, 0, 0, kTrayPopupTextSpacingVertical)); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 } | 179 } |
182 | 180 |
183 bool TimeView::PerformAction(const views::Event& event) { | 181 bool TimeView::PerformAction(const views::Event& event) { |
184 return false; | 182 return false; |
185 } | 183 } |
186 | 184 |
187 | 185 |
188 } // namespace tray | 186 } // namespace tray |
189 } // namespace internal | 187 } // namespace internal |
190 } // namespace ash | 188 } // namespace ash |
OLD | NEW |