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/chromeos/network/tray_sms.h" | 5 #include "ash/system/chromeos/network/tray_sms.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/system/tray/fixed_sized_scroll_view.h" | 8 #include "ash/system/tray/fixed_sized_scroll_view.h" |
9 #include "ash/system/tray/system_tray.h" | 9 #include "ash/system/tray/system_tray.h" |
10 #include "ash/system/tray/system_tray_bubble.h" | 10 #include "ash/system/tray/system_tray_bubble.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 CreateSpecialRow(IDS_ASH_STATUS_TRAY_SMS, this); | 193 CreateSpecialRow(IDS_ASH_STATUS_TRAY_SMS, this); |
194 } | 194 } |
195 | 195 |
196 void Update() { | 196 void Update() { |
197 UpdateMessageList(); | 197 UpdateMessageList(); |
198 Layout(); | 198 Layout(); |
199 SchedulePaint(); | 199 SchedulePaint(); |
200 } | 200 } |
201 | 201 |
202 // Overridden from views::View. | 202 // Overridden from views::View. |
203 virtual gfx::Size GetPreferredSize() OVERRIDE { | 203 virtual gfx::Size GetPreferredSize() const OVERRIDE { |
204 gfx::Size preferred_size = TrayDetailsView::GetPreferredSize(); | 204 gfx::Size preferred_size = TrayDetailsView::GetPreferredSize(); |
205 if (preferred_size.height() < kMessageListMinHeight) | 205 if (preferred_size.height() < kMessageListMinHeight) |
206 preferred_size.set_height(kMessageListMinHeight); | 206 preferred_size.set_height(kMessageListMinHeight); |
207 return preferred_size; | 207 return preferred_size; |
208 } | 208 } |
209 | 209 |
210 private: | 210 private: |
211 void UpdateMessageList() { | 211 void UpdateMessageList() { |
212 const base::ListValue& messages = | 212 const base::ListValue& messages = |
213 static_cast<TraySms*>(owner())->messages(); | 213 static_cast<TraySms*>(owner())->messages(); |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 std::string number, text; | 410 std::string number, text; |
411 if (GetLatestMessage(&index, &number, &text)) | 411 if (GetLatestMessage(&index, &number, &text)) |
412 notification_->Update(index, number, text); | 412 notification_->Update(index, number, text); |
413 } else if (notify) { | 413 } else if (notify) { |
414 ShowNotificationView(); | 414 ShowNotificationView(); |
415 } | 415 } |
416 } | 416 } |
417 } | 417 } |
418 | 418 |
419 } // namespace ash | 419 } // namespace ash |
OLD | NEW |