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

Unified Diff: ui/message_center/notification_list.cc

Issue 12335024: Change eventTime field to standard chrome.* API format. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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/notification.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/notification_list.cc
diff --git a/ui/message_center/notification_list.cc b/ui/message_center/notification_list.cc
index 322a9e871b3f9ba58f213037202ecf1ee3df2038..677c24d5aa69dddd898a85eec6ffc61effdbe9cd 100644
--- a/ui/message_center/notification_list.cc
+++ b/ui/message_center/notification_list.cc
@@ -64,9 +64,7 @@ void NotificationList::AddNotification(
notification.extension_id = extension_id;
// Initialize primitive fields before unpacking optional fields.
- // timestamp initializes to default NULL time.
notification.priority = ui::notifications::DEFAULT_PRIORITY;
- notification.unread_count = 0;
UnpackOptionalFields(optional_fields, &notification);
@@ -80,12 +78,10 @@ void NotificationList::UnpackOptionalFields(const DictionaryValue* fields,
fields->GetInteger(ui::notifications::kPriorityKey, &notification->priority);
if (fields->HasKey(ui::notifications::kTimestampKey)) {
- std::string time_string;
- fields->GetString(ui::notifications::kTimestampKey, &time_string);
- base::Time::FromString(time_string.c_str(), &notification->timestamp);
+ double time_double;
+ fields->GetDouble(ui::notifications::kTimestampKey, &time_double);
+ notification->timestamp = base::Time::FromJsTime(time_double);
}
- fields->GetInteger(ui::notifications::kUnreadCountKey,
- &notification->unread_count);
if (fields->HasKey(ui::notifications::kButtonOneTitleKey) ||
fields->HasKey(ui::notifications::kButtonOneIconUrlKey)) {
string16 title;
« no previous file with comments | « ui/message_center/notification.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698