| 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_tray.h" | 5 #include "ui/message_center/message_center_tray.h" |
| 6 | 6 |
| 7 #include "base/observer_list.h" | 7 #include "base/observer_list.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "grit/ui_strings.h" | 9 #include "grit/ui_strings.h" |
| 10 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 } | 226 } |
| 227 | 227 |
| 228 void MessageCenterTray::OnNotificationButtonClicked( | 228 void MessageCenterTray::OnNotificationButtonClicked( |
| 229 const std::string& notification_id, | 229 const std::string& notification_id, |
| 230 int button_index) { | 230 int button_index) { |
| 231 if (popups_visible_) | 231 if (popups_visible_) |
| 232 OnMessageCenterChanged(); | 232 OnMessageCenterChanged(); |
| 233 } | 233 } |
| 234 | 234 |
| 235 void MessageCenterTray::OnNotificationDisplayed( | 235 void MessageCenterTray::OnNotificationDisplayed( |
| 236 const std::string& notification_id) { | 236 const std::string& notification_id, |
| 237 const NotificationDisplaySource source) { |
| 237 NotifyMessageCenterTrayChanged(); | 238 NotifyMessageCenterTrayChanged(); |
| 238 } | 239 } |
| 239 | 240 |
| 240 void MessageCenterTray::OnQuietModeChanged(bool in_quiet_mode) { | 241 void MessageCenterTray::OnQuietModeChanged(bool in_quiet_mode) { |
| 241 NotifyMessageCenterTrayChanged(); | 242 NotifyMessageCenterTrayChanged(); |
| 242 } | 243 } |
| 243 | 244 |
| 244 void MessageCenterTray::OnBlockingStateChanged(NotificationBlocker* blocker) { | 245 void MessageCenterTray::OnBlockingStateChanged(NotificationBlocker* blocker) { |
| 245 OnMessageCenterChanged(); | 246 OnMessageCenterChanged(); |
| 246 } | 247 } |
| 247 | 248 |
| 248 void MessageCenterTray::OnMessageCenterChanged() { | 249 void MessageCenterTray::OnMessageCenterChanged() { |
| 249 if (message_center_visible_ && message_center_->NotificationCount() == 0) | 250 if (message_center_visible_ && message_center_->NotificationCount() == 0) |
| 250 HideMessageCenterBubble(); | 251 HideMessageCenterBubble(); |
| 251 | 252 |
| 252 if (popups_visible_ && !message_center_->HasPopupNotifications()) | 253 if (popups_visible_ && !message_center_->HasPopupNotifications()) |
| 253 HidePopupBubbleInternal(); | 254 HidePopupBubbleInternal(); |
| 254 else if (!popups_visible_ && message_center_->HasPopupNotifications()) | 255 else if (!popups_visible_ && message_center_->HasPopupNotifications()) |
| 255 ShowPopupBubble(); | 256 ShowPopupBubble(); |
| 256 | 257 |
| 257 NotifyMessageCenterTrayChanged(); | 258 NotifyMessageCenterTrayChanged(); |
| 258 } | 259 } |
| 259 | 260 |
| 260 void MessageCenterTray::NotifyMessageCenterTrayChanged() { | 261 void MessageCenterTray::NotifyMessageCenterTrayChanged() { |
| 261 delegate_->OnMessageCenterTrayChanged(); | 262 delegate_->OnMessageCenterTrayChanged(); |
| 262 } | 263 } |
| 263 | 264 |
| 264 } // namespace message_center | 265 } // namespace message_center |
| OLD | NEW |