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

Unified Diff: ui/notifications/notification_types.cc

Issue 11639041: Added support for image notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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
Index: ui/notifications/notification_types.cc
diff --git a/ui/notifications/notification_types.cc b/ui/notifications/notification_types.cc
index 1b720d68582d9b76a7bd0e8adce42589755eddf0..484d4713d05f9f1f6099d85815960b56b326982a 100644
--- a/ui/notifications/notification_types.cc
+++ b/ui/notifications/notification_types.cc
@@ -8,6 +8,7 @@ namespace {
const char kSimpleType[] = "simple";
const char kBaseFormatType[] = "base";
+const char kImageType[] = "image";
const char kMultipleType[] = "multiple";
} // namespace
@@ -32,15 +33,12 @@ const char kItemTitleKey[] = "title";
const char kItemMessageKey[] = "message";
NotificationType StringToNotificationType(std::string& string_type) {
- if (string_type == kSimpleType)
- return NOTIFICATION_TYPE_SIMPLE;
- if (string_type == kBaseFormatType)
- return NOTIFICATION_TYPE_BASE_FORMAT;
- if (string_type == kMultipleType)
- return NOTIFICATION_TYPE_MULTIPLE;
-
// In case of unrecognized string, fall back to most common type.
- return NOTIFICATION_TYPE_SIMPLE;
+ return (string_type == kSimpleType) ? NOTIFICATION_TYPE_SIMPLE :
+ (string_type == kBaseFormatType) ? NOTIFICATION_TYPE_BASE_FORMAT :
+ (string_type == kImageType) ? NOTIFICATION_TYPE_IMAGE :
+ (string_type == kMultipleType) ? NOTIFICATION_TYPE_MULTIPLE :
+ NOTIFICATION_TYPE_SIMPLE;
}
} // namespace notifications
« ui/message_center/notification_view.cc ('K') | « ui/notifications/notification_types.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698