| 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 "ui/message_center/message_center.h" | 5 #include "ui/message_center/message_center.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
| 10 | 10 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 if (delegate_) | 136 if (delegate_) |
| 137 delegate_->DisableNotificationsFromSource(id); | 137 delegate_->DisableNotificationsFromSource(id); |
| 138 notification_list_->SendRemoveNotificationsBySource(id); | 138 notification_list_->SendRemoveNotificationsBySource(id); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void MessageCenter::ShowNotificationSettings(const std::string& id) { | 141 void MessageCenter::ShowNotificationSettings(const std::string& id) { |
| 142 if (delegate_) | 142 if (delegate_) |
| 143 delegate_->ShowSettings(id); | 143 delegate_->ShowSettings(id); |
| 144 } | 144 } |
| 145 | 145 |
| 146 void MessageCenter::ShowNotificationSettingsDialog(gfx::NativeView context) { |
| 147 if (delegate_) |
| 148 delegate_->ShowSettingsDialog(context); |
| 149 } |
| 150 |
| 146 void MessageCenter::OnNotificationClicked(const std::string& id) { | 151 void MessageCenter::OnNotificationClicked(const std::string& id) { |
| 147 if (delegate_) | 152 if (delegate_) |
| 148 delegate_->OnClicked(id); | 153 delegate_->OnClicked(id); |
| 149 if (HasPopupNotifications()) { | 154 if (HasPopupNotifications()) { |
| 150 notification_list_->MarkSinglePopupAsShown(id, true); | 155 notification_list_->MarkSinglePopupAsShown(id, true); |
| 151 NotifyMessageCenterChanged(false); | 156 NotifyMessageCenterChanged(false); |
| 152 } | 157 } |
| 153 } | 158 } |
| 154 | 159 |
| 155 void MessageCenter::OnQuietModeChanged(bool quiet_mode) { | 160 void MessageCenter::OnQuietModeChanged(bool quiet_mode) { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 182 } | 187 } |
| 183 | 188 |
| 184 void MessageCenter::NotifyMessageCenterChanged(bool new_notification) { | 189 void MessageCenter::NotifyMessageCenterChanged(bool new_notification) { |
| 185 FOR_EACH_OBSERVER(Observer, | 190 FOR_EACH_OBSERVER(Observer, |
| 186 observer_list_, | 191 observer_list_, |
| 187 OnMessageCenterChanged(new_notification)); | 192 OnMessageCenterChanged(new_notification)); |
| 188 } | 193 } |
| 189 | 194 |
| 190 | 195 |
| 191 } // namespace message_center | 196 } // namespace message_center |
| OLD | NEW |