| 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/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 std::unique_ptr<ui::MenuModel> MessageCenterTray::CreateNotificationMenuModel( | 195 std::unique_ptr<ui::MenuModel> MessageCenterTray::CreateNotificationMenuModel( |
| 196 const NotifierId& notifier_id, | 196 const NotifierId& notifier_id, |
| 197 const base::string16& display_source) { | 197 const base::string16& display_source) { |
| 198 #if !defined(OS_CHROMEOS) | 198 #if !defined(OS_CHROMEOS) |
| 199 // Only web pages are configurable on non-chromeos platforms. | 199 // Only web pages are configurable on non-chromeos platforms. |
| 200 if (notifier_id.type != NotifierId::WEB_PAGE) { | 200 if (notifier_id.type != NotifierId::WEB_PAGE) { |
| 201 return nullptr; | 201 return nullptr; |
| 202 } | 202 } |
| 203 #endif | 203 #endif |
| 204 | 204 |
| 205 return base::WrapUnique( | 205 return base::MakeUnique<NotificationMenuModel>(this, notifier_id, |
| 206 new NotificationMenuModel(this, notifier_id, display_source)); | 206 display_source); |
| 207 } | 207 } |
| 208 | 208 |
| 209 void MessageCenterTray::OnNotificationAdded( | 209 void MessageCenterTray::OnNotificationAdded( |
| 210 const std::string& notification_id) { | 210 const std::string& notification_id) { |
| 211 OnMessageCenterChanged(); | 211 OnMessageCenterChanged(); |
| 212 } | 212 } |
| 213 | 213 |
| 214 void MessageCenterTray::OnNotificationRemoved( | 214 void MessageCenterTray::OnNotificationRemoved( |
| 215 const std::string& notification_id, | 215 const std::string& notification_id, |
| 216 bool by_user) { | 216 bool by_user) { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 ShowPopupBubble(); | 259 ShowPopupBubble(); |
| 260 | 260 |
| 261 NotifyMessageCenterTrayChanged(); | 261 NotifyMessageCenterTrayChanged(); |
| 262 } | 262 } |
| 263 | 263 |
| 264 void MessageCenterTray::NotifyMessageCenterTrayChanged() { | 264 void MessageCenterTray::NotifyMessageCenterTrayChanged() { |
| 265 delegate_->OnMessageCenterTrayChanged(); | 265 delegate_->OnMessageCenterTrayChanged(); |
| 266 } | 266 } |
| 267 | 267 |
| 268 } // namespace message_center | 268 } // namespace message_center |
| OLD | NEW |