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/common/system/chromeos/network/tray_sms.h" | 5 #include "ash/common/system/chromeos/network/tray_sms.h" |
6 | 6 |
7 #include "ash/common/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.h" |
8 #include "ash/common/metrics/user_metrics_action.h" | 8 #include "ash/common/metrics/user_metrics_action.h" |
9 #include "ash/common/system/tray/fixed_sized_scroll_view.h" | 9 #include "ash/common/system/tray/fixed_sized_scroll_view.h" |
10 #include "ash/common/system/tray/system_tray.h" | 10 #include "ash/common/system/tray/system_tray.h" |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 return false; | 404 return false; |
405 messages_.Remove(index, nullptr); | 405 messages_.Remove(index, nullptr); |
406 return true; | 406 return true; |
407 } | 407 } |
408 | 408 |
409 void TraySms::Update(bool notify) { | 409 void TraySms::Update(bool notify) { |
410 if (messages_.empty()) { | 410 if (messages_.empty()) { |
411 if (default_) | 411 if (default_) |
412 default_->SetVisible(false); | 412 default_->SetVisible(false); |
413 if (detailed_) | 413 if (detailed_) |
414 HideDetailedView(); | 414 HideDetailedView(true /* animate */); |
415 HideNotificationView(); | 415 HideNotificationView(); |
416 } else { | 416 } else { |
417 if (default_) { | 417 if (default_) { |
418 default_->SetVisible(true); | 418 default_->SetVisible(true); |
419 default_->Update(); | 419 default_->Update(); |
420 } | 420 } |
421 if (detailed_) | 421 if (detailed_) |
422 detailed_->Update(); | 422 detailed_->Update(); |
423 if (notification_) { | 423 if (notification_) { |
424 size_t index; | 424 size_t index; |
425 std::string number, text; | 425 std::string number, text; |
426 if (GetLatestMessage(&index, &number, &text)) | 426 if (GetLatestMessage(&index, &number, &text)) |
427 notification_->Update(index, number, text); | 427 notification_->Update(index, number, text); |
428 } else if (notify) { | 428 } else if (notify) { |
429 ShowNotificationView(); | 429 ShowNotificationView(); |
430 } | 430 } |
431 } | 431 } |
432 } | 432 } |
433 | 433 |
434 } // namespace ash | 434 } // namespace ash |
OLD | NEW |