| 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; |
| 798 if (delegate.get()) | 800 if (delegate.get()) |
| 799 delegate->SettingsClick(); | 801 handled_by_delegate = delegate->SettingsClick(); |
| 802 |
| 800 for (auto& observer : observer_list_) | 803 for (auto& observer : observer_list_) |
| 801 observer.OnNotificationSettingsClicked(); | 804 observer.OnNotificationSettingsClicked(handled_by_delegate); |
| 802 } | 805 } |
| 803 | 806 |
| 804 void MessageCenterImpl::MarkSinglePopupAsShown(const std::string& id, | 807 void MessageCenterImpl::MarkSinglePopupAsShown(const std::string& id, |
| 805 bool mark_notification_as_read) { | 808 bool mark_notification_as_read) { |
| 806 if (FindVisibleNotificationById(id) == NULL) | 809 if (FindVisibleNotificationById(id) == NULL) |
| 807 return; | 810 return; |
| 808 #if !defined(OS_CHROMEOS) | 811 #if !defined(OS_CHROMEOS) |
| 809 return this->RemoveNotification(id, false); | 812 return this->RemoveNotification(id, false); |
| 810 #else | 813 #else |
| 811 notification_list_->MarkSinglePopupAsShown(id, mark_notification_as_read); | 814 notification_list_->MarkSinglePopupAsShown(id, mark_notification_as_read); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 899 } | 902 } |
| 900 | 903 |
| 901 void MessageCenterImpl::EnableChangeQueueForTest(bool enable) { | 904 void MessageCenterImpl::EnableChangeQueueForTest(bool enable) { |
| 902 if (enable) | 905 if (enable) |
| 903 notification_queue_.reset(new internal::ChangeQueue()); | 906 notification_queue_.reset(new internal::ChangeQueue()); |
| 904 else | 907 else |
| 905 notification_queue_.reset(); | 908 notification_queue_.reset(); |
| 906 } | 909 } |
| 907 | 910 |
| 908 } // namespace message_center | 911 } // namespace message_center |
| OLD | NEW |