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

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: Fix bug detected by try bots. Created 7 years, 12 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/notifications/notification_types.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/notifications/notification_types.cc
diff --git a/ui/notifications/notification_types.cc b/ui/notifications/notification_types.cc
index 80bceadcff8bfbb0aa22c2bfde454719f82cc42d..9bfe1f55f7f8c794a3a3db7f8a58c606a18fb7a6 100644
--- a/ui/notifications/notification_types.cc
+++ b/ui/notifications/notification_types.cc
@@ -25,18 +25,16 @@ const char kItemMessageKey[] = "message";
const char kSimpleType[] = "simple";
const char kBaseFormatType[] = "base";
+const char kImageType[] = "image";
const char kMultipleType[] = "multiple";
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
« no previous file with comments | « ui/notifications/notification_types.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698