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_view_factory.h" | 5 #include "ui/message_center/message_view_factory.h" |
6 | 6 |
7 #include "ui/message_center/base_format_view.h" | 7 #include "ui/message_center/base_format_view.h" |
8 #include "ui/message_center/message_simple_view.h" | 8 #include "ui/message_center/message_simple_view.h" |
9 #include "ui/message_center/message_view.h" | 9 #include "ui/message_center/message_view.h" |
| 10 #include "ui/message_center/message_view_multiple.h" |
10 #include "ui/message_center/notification_list.h" | 11 #include "ui/message_center/notification_list.h" |
11 #include "ui/notifications/notification_types.h" | 12 #include "ui/notifications/notification_types.h" |
12 | 13 |
13 namespace message_center { | 14 namespace message_center { |
14 | 15 |
15 // static | 16 // static |
16 MessageView* MessageViewFactory::ViewForNotification( | 17 MessageView* MessageViewFactory::ViewForNotification( |
17 const NotificationList::Notification& notification, | 18 const NotificationList::Notification& notification, |
18 NotificationList::Delegate* list_delegate) { | 19 NotificationList::Delegate* list_delegate) { |
19 switch (notification.type) { | 20 switch (notification.type) { |
20 case ui::notifications::NOTIFICATION_TYPE_BASE_FORMAT: | 21 case ui::notifications::NOTIFICATION_TYPE_BASE_FORMAT: |
21 return new BaseFormatView(list_delegate, notification); | 22 return new BaseFormatView(list_delegate, notification); |
| 23 case ui::notifications::NOTIFICATION_TYPE_MULTIPLE: |
| 24 return new MessageViewMultiple(list_delegate, notification); |
22 case ui::notifications::NOTIFICATION_TYPE_SIMPLE: | 25 case ui::notifications::NOTIFICATION_TYPE_SIMPLE: |
23 return new MessageSimpleView(list_delegate, notification); | 26 return new MessageSimpleView(list_delegate, notification); |
24 | 27 |
25 default: | 28 default: |
26 // If the caller asks for an unrecognized kind of view (entirely possible | 29 // If the caller asks for an unrecognized kind of view (entirely possible |
27 // if an application is running on an older version of this code that | 30 // if an application is running on an older version of this code that |
28 // doesn't have the requested kind of notification template), we'll fall | 31 // doesn't have the requested kind of notification template), we'll fall |
29 // back to the simplest kind of notification. | 32 // back to the simplest kind of notification. |
30 LOG(WARNING) << "Unable to fulfill request for unrecognized " | 33 LOG(WARNING) << "Unable to fulfill request for unrecognized " |
31 << "notification type " << notification.type << ". " | 34 << "notification type " << notification.type << ". " |
32 << "Falling back to simple notification type."; | 35 << "Falling back to simple notification type."; |
33 return new MessageSimpleView(list_delegate, notification); | 36 return new MessageSimpleView(list_delegate, notification); |
34 } | 37 } |
35 NOTREACHED(); | 38 NOTREACHED(); |
36 } | 39 } |
37 | 40 |
38 } // namespace message_center | 41 } // namespace message_center |
OLD | NEW |