| 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/network/tray_sms.h" | 5 #include "ash/system/network/tray_sms.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/system/tray/system_tray.h" | 9 #include "ash/system/tray/system_tray.h" |
| 10 #include "ash/system/tray/tray_constants.h" | 10 #include "ash/system/tray/tray_constants.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 if (preferred_size.height() < kMessageListMinHeight) | 202 if (preferred_size.height() < kMessageListMinHeight) |
| 203 preferred_size.set_height(kMessageListMinHeight); | 203 preferred_size.set_height(kMessageListMinHeight); |
| 204 return preferred_size; | 204 return preferred_size; |
| 205 } | 205 } |
| 206 | 206 |
| 207 private: | 207 private: |
| 208 void UpdateMessageList() { | 208 void UpdateMessageList() { |
| 209 const base::ListValue& messages = tray_->messages(); | 209 const base::ListValue& messages = tray_->messages(); |
| 210 scroll_content()->RemoveAllChildViews(true); | 210 scroll_content()->RemoveAllChildViews(true); |
| 211 for (size_t index = 0; index < messages.GetSize(); ++index) { | 211 for (size_t index = 0; index < messages.GetSize(); ++index) { |
| 212 base::DictionaryValue* message = NULL; | 212 const base::DictionaryValue* message = NULL; |
| 213 if (!messages.GetDictionary(index, &message)) { | 213 if (!messages.GetDictionary(index, &message)) { |
| 214 LOG(ERROR) << "SMS message not a dictionary at: " << index; | 214 LOG(ERROR) << "SMS message not a dictionary at: " << index; |
| 215 continue; | 215 continue; |
| 216 } | 216 } |
| 217 std::string number, text; | 217 std::string number, text; |
| 218 if (!GetMessageFromDictionary(message, &number, &text)) { | 218 if (!GetMessageFromDictionary(message, &number, &text)) { |
| 219 LOG(ERROR) << "Error parsing SMS message"; | 219 LOG(ERROR) << "Error parsing SMS message"; |
| 220 continue; | 220 continue; |
| 221 } | 221 } |
| 222 SmsMessageView* msgview = new SmsMessageView( | 222 SmsMessageView* msgview = new SmsMessageView( |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 if (GetLatestMessage(&index, &number, &text)) | 369 if (GetLatestMessage(&index, &number, &text)) |
| 370 notification_->Update(index, number, text); | 370 notification_->Update(index, number, text); |
| 371 } else if (notify) { | 371 } else if (notify) { |
| 372 ShowNotificationView(); | 372 ShowNotificationView(); |
| 373 } | 373 } |
| 374 } | 374 } |
| 375 } | 375 } |
| 376 | 376 |
| 377 } // namespace internal | 377 } // namespace internal |
| 378 } // namespace ash | 378 } // namespace ash |
| OLD | NEW |