Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(329)

Side by Side Diff: ui/message_center/message_view_factory.cc

Issue 11926032: Updated the look of web and basic notifications to match latest mockups. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ui/message_center/message_view_factory.h"
6
7 #include "ui/message_center/base_format_view.h"
8 #include "ui/message_center/message_simple_view.h"
9 #include "ui/message_center/message_view.h"
10 #include "ui/message_center/notification_list.h"
11 #include "ui/message_center/notification_view.h"
12 #include "ui/notifications/notification_types.h"
13
14 namespace message_center {
15
16 // static
17 MessageView* MessageViewFactory::ViewForNotification(
18 const NotificationList::Notification& notification,
19 NotificationList::Delegate* list_delegate) {
20 switch (notification.type) {
21 case ui::notifications::NOTIFICATION_TYPE_BASE_FORMAT:
22 return new BaseFormatView(list_delegate, notification);
23 case ui::notifications::NOTIFICATION_TYPE_IMAGE:
24 return new NotificationView(list_delegate, notification);
25 case ui::notifications::NOTIFICATION_TYPE_MULTIPLE:
26 return new NotificationView(list_delegate, notification);
27 case ui::notifications::NOTIFICATION_TYPE_SIMPLE:
28 return new MessageSimpleView(list_delegate, notification);
29
30 default:
31 // If the caller asks for an unrecognized kind of view (entirely possible
32 // if an application is running on an older version of this code that
33 // doesn't have the requested kind of notification template), we'll fall
34 // back to the simplest kind of notification.
35 LOG(WARNING) << "Unable to fulfill request for unrecognized "
36 << "notification type " << notification.type << ". "
37 << "Falling back to simple notification type.";
38 return new MessageSimpleView(list_delegate, notification);
39 }
40 NOTREACHED();
41 }
42
43 } // namespace message_center
dharcourt 2013/01/19 03:06:13 MessageViewFactory replaced by a class method in N
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698