| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ui/message_center/message_center_impl.h" | 5 #include "ui/message_center/message_center_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 notification_list_->GetNotificationDelegate(id); | 788 notification_list_->GetNotificationDelegate(id); |
| 789 if (delegate.get()) | 789 if (delegate.get()) |
| 790 delegate->ButtonClick(button_index); | 790 delegate->ButtonClick(button_index); |
| 791 for (auto& observer : observer_list_) | 791 for (auto& observer : observer_list_) |
| 792 observer.OnNotificationButtonClicked(id, button_index); | 792 observer.OnNotificationButtonClicked(id, button_index); |
| 793 } | 793 } |
| 794 | 794 |
| 795 void MessageCenterImpl::ClickOnSettingsButton(const std::string& id) { | 795 void MessageCenterImpl::ClickOnSettingsButton(const std::string& id) { |
| 796 scoped_refptr<NotificationDelegate> delegate = | 796 scoped_refptr<NotificationDelegate> delegate = |
| 797 notification_list_->GetNotificationDelegate(id); | 797 notification_list_->GetNotificationDelegate(id); |
| 798 | |
| 799 bool handled_by_delegate = false; | |
| 800 if (delegate.get()) | 798 if (delegate.get()) |
| 801 handled_by_delegate = delegate->SettingsClick(); | 799 delegate->SettingsClick(); |
| 802 | |
| 803 for (auto& observer : observer_list_) | 800 for (auto& observer : observer_list_) |
| 804 observer.OnNotificationSettingsClicked(handled_by_delegate); | 801 observer.OnNotificationSettingsClicked(); |
| 805 } | 802 } |
| 806 | 803 |
| 807 void MessageCenterImpl::MarkSinglePopupAsShown(const std::string& id, | 804 void MessageCenterImpl::MarkSinglePopupAsShown(const std::string& id, |
| 808 bool mark_notification_as_read) { | 805 bool mark_notification_as_read) { |
| 809 if (FindVisibleNotificationById(id) == NULL) | 806 if (FindVisibleNotificationById(id) == NULL) |
| 810 return; | 807 return; |
| 811 #if !defined(OS_CHROMEOS) | 808 #if !defined(OS_CHROMEOS) |
| 812 return this->RemoveNotification(id, false); | 809 return this->RemoveNotification(id, false); |
| 813 #else | 810 #else |
| 814 notification_list_->MarkSinglePopupAsShown(id, mark_notification_as_read); | 811 notification_list_->MarkSinglePopupAsShown(id, mark_notification_as_read); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 902 } | 899 } |
| 903 | 900 |
| 904 void MessageCenterImpl::EnableChangeQueueForTest(bool enable) { | 901 void MessageCenterImpl::EnableChangeQueueForTest(bool enable) { |
| 905 if (enable) | 902 if (enable) |
| 906 notification_queue_.reset(new internal::ChangeQueue()); | 903 notification_queue_.reset(new internal::ChangeQueue()); |
| 907 else | 904 else |
| 908 notification_queue_.reset(); | 905 notification_queue_.reset(); |
| 909 } | 906 } |
| 910 | 907 |
| 911 } // namespace message_center | 908 } // namespace message_center |
| OLD | NEW |