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

Unified Diff: ui/message_center/views/message_view_factory.cc

Issue 2892893002: Initial implementation of new-style notification (Closed)
Patch Set: addressed comments Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/message_center/views/message_view.cc ('k') | ui/message_center/views/notification_view_md.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/views/message_view_factory.cc
diff --git a/ui/message_center/views/message_view_factory.cc b/ui/message_center/views/message_view_factory.cc
index f1c982f4b99c2248a6fa0820d6756aa7256fabfa..60567af45334bef4c299fc262d45e05a65bd9699 100644
--- a/ui/message_center/views/message_view_factory.cc
+++ b/ui/message_center/views/message_view_factory.cc
@@ -4,8 +4,11 @@
#include "ui/message_center/views/message_view_factory.h"
+#include "base/command_line.h"
+#include "ui/message_center/message_center_switches.h"
#include "ui/message_center/notification_types.h"
#include "ui/message_center/views/notification_view.h"
+#include "ui/message_center/views/notification_view_md.h"
#if defined(OS_WIN)
#include "ui/base/win/shell.h"
@@ -23,10 +26,23 @@ MessageView* MessageViewFactory::Create(MessageCenterController* controller,
case NOTIFICATION_TYPE_IMAGE:
case NOTIFICATION_TYPE_MULTIPLE:
case NOTIFICATION_TYPE_SIMPLE:
- case NOTIFICATION_TYPE_PROGRESS:
+ case NOTIFICATION_TYPE_PROGRESS: {
+ bool new_style_notification_enabled = false; // default value
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableMessageCenterNewStyleNotification)) {
+ new_style_notification_enabled = true;
+ } else if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableMessageCenterNewStyleNotification)) {
+ new_style_notification_enabled = false;
+ }
+
// All above roads lead to the generic NotificationView.
- notification_view = new NotificationView(controller, notification);
+ if (new_style_notification_enabled)
+ notification_view = new NotificationViewMD(controller, notification);
+ else
+ notification_view = new NotificationView(controller, notification);
break;
+ }
#if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX)
case NOTIFICATION_TYPE_CUSTOM:
notification_view =
« no previous file with comments | « ui/message_center/views/message_view.cc ('k') | ui/message_center/views/notification_view_md.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698