summaryrefslogtreecommitdiff
path: root/chromium/ui/message_center/views/message_view_factory.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ui/message_center/views/message_view_factory.cc')
-rw-r--r--chromium/ui/message_center/views/message_view_factory.cc24
1 files changed, 18 insertions, 6 deletions
diff --git a/chromium/ui/message_center/views/message_view_factory.cc b/chromium/ui/message_center/views/message_view_factory.cc
index 0ce0d313328..8db23c841cc 100644
--- a/chromium/ui/message_center/views/message_view_factory.cc
+++ b/chromium/ui/message_center/views/message_view_factory.cc
@@ -11,9 +11,12 @@
#include "base/lazy_instance.h"
#include "ui/message_center/public/cpp/features.h"
#include "ui/message_center/public/cpp/notification_types.h"
-#include "ui/message_center/views/notification_view.h"
#include "ui/message_center/views/notification_view_md.h"
+#if !defined(OS_CHROMEOS)
+#include "ui/message_center/views/notification_view.h"
+#endif
+
namespace message_center {
namespace {
@@ -43,11 +46,7 @@ MessageView* MessageViewFactory::Create(const Notification& notification) {
case NOTIFICATION_TYPE_MULTIPLE:
case NOTIFICATION_TYPE_SIMPLE:
case NOTIFICATION_TYPE_PROGRESS:
- // All above roads lead to the generic NotificationView.
- if (base::FeatureList::IsEnabled(message_center::kNewStyleNotifications))
- notification_view = new NotificationViewMD(notification);
- else
- notification_view = new NotificationView(notification);
+ // Rely on default construction after the switch.
break;
case NOTIFICATION_TYPE_CUSTOM:
notification_view = GetCustomNotificationView(notification).release();
@@ -61,8 +60,21 @@ MessageView* MessageViewFactory::Create(const Notification& notification) {
LOG(WARNING) << "Unable to fulfill request for unrecognized or"
<< "unsupported notification type " << notification.type()
<< ". Falling back to simple notification type.";
+ break;
+ }
+
+ if (!notification_view) {
+#if defined(OS_CHROMEOS)
+ notification_view = new NotificationViewMD(notification);
+#else
+ // All above roads lead to the generic NotificationView.
+ if (base::FeatureList::IsEnabled(message_center::kNewStyleNotifications))
+ notification_view = new NotificationViewMD(notification);
+ else
notification_view = new NotificationView(notification);
+#endif
}
+
return notification_view;
}