| 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/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/system_tray_bubble.h" | 10 #include "ash/system/tray/system_tray_bubble.h" |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 CHECK(detailed_ == NULL); | 301 CHECK(detailed_ == NULL); |
| 302 HideNotificationView(); | 302 HideNotificationView(); |
| 303 if (messages_.empty()) | 303 if (messages_.empty()) |
| 304 return NULL; | 304 return NULL; |
| 305 detailed_ = new SmsDetailedView(this); | 305 detailed_ = new SmsDetailedView(this); |
| 306 return detailed_; | 306 return detailed_; |
| 307 } | 307 } |
| 308 | 308 |
| 309 views::View* TraySms::CreateNotificationView(user::LoginStatus status) { | 309 views::View* TraySms::CreateNotificationView(user::LoginStatus status) { |
| 310 CHECK(notification_ == NULL); | 310 CHECK(notification_ == NULL); |
| 311 if (detailed_) |
| 312 return NULL; |
| 311 size_t index; | 313 size_t index; |
| 312 std::string number, text; | 314 std::string number, text; |
| 313 if (GetLatestMessage(&index, &number, &text)) | 315 if (GetLatestMessage(&index, &number, &text)) |
| 314 notification_ = new SmsNotificationView(this, index, number, text); | 316 notification_ = new SmsNotificationView(this, index, number, text); |
| 315 return notification_; | 317 return notification_; |
| 316 } | 318 } |
| 317 | 319 |
| 318 void TraySms::DestroyDefaultView() { | 320 void TraySms::DestroyDefaultView() { |
| 319 default_ = NULL; | 321 default_ = NULL; |
| 320 } | 322 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 if (GetLatestMessage(&index, &number, &text)) | 374 if (GetLatestMessage(&index, &number, &text)) |
| 373 notification_->Update(index, number, text); | 375 notification_->Update(index, number, text); |
| 374 } else if (notify) { | 376 } else if (notify) { |
| 375 ShowNotificationView(); | 377 ShowNotificationView(); |
| 376 } | 378 } |
| 377 } | 379 } |
| 378 } | 380 } |
| 379 | 381 |
| 380 } // namespace internal | 382 } // namespace internal |
| 381 } // namespace ash | 383 } // namespace ash |
| OLD | NEW |