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

Side by Side Diff: chrome/browser/notifications/platform_notification_service_impl.cc

Issue 1388483002: Implement the Notification `timestamp` property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/notifications/platform_notification_service_impl.h" 5 #include "chrome/browser/notifications/platform_notification_service_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 message_center::NOTIFICATION_TYPE_SIMPLE, notification_data.title, 474 message_center::NOTIFICATION_TYPE_SIMPLE, notification_data.title,
475 notification_data.body, 475 notification_data.body,
476 gfx::Image::CreateFrom1xBitmap(notification_resources.notification_icon), 476 gfx::Image::CreateFrom1xBitmap(notification_resources.notification_icon),
477 message_center::NotifierId(origin), base::UTF8ToUTF16(origin.host()), 477 message_center::NotifierId(origin), base::UTF8ToUTF16(origin.host()),
478 origin, notification_data.tag, message_center::RichNotificationData(), 478 origin, notification_data.tag, message_center::RichNotificationData(),
479 delegate); 479 delegate);
480 480
481 notification.set_context_message( 481 notification.set_context_message(
482 DisplayNameForContextMessage(profile, origin)); 482 DisplayNameForContextMessage(profile, origin));
483 notification.set_vibration_pattern(notification_data.vibration_pattern); 483 notification.set_vibration_pattern(notification_data.vibration_pattern);
484 notification.set_timestamp(notification_data.timestamp);
484 notification.set_silent(notification_data.silent); 485 notification.set_silent(notification_data.silent);
485 486
486 std::vector<message_center::ButtonInfo> buttons; 487 std::vector<message_center::ButtonInfo> buttons;
487 488
488 // Developer supplied buttons. 489 // Developer supplied buttons.
489 for (const auto& action : notification_data.actions) 490 for (const auto& action : notification_data.actions)
490 buttons.push_back(message_center::ButtonInfo(action.title)); 491 buttons.push_back(message_center::ButtonInfo(action.title));
491 492
492 notification.set_buttons(buttons); 493 notification.set_buttons(buttons);
493 494
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 extensions::ExtensionRegistry::Get(profile)->GetExtensionById( 550 extensions::ExtensionRegistry::Get(profile)->GetExtensionById(
550 origin.host(), extensions::ExtensionRegistry::EVERYTHING); 551 origin.host(), extensions::ExtensionRegistry::EVERYTHING);
551 DCHECK(extension); 552 DCHECK(extension);
552 553
553 return base::UTF8ToUTF16(extension->name()); 554 return base::UTF8ToUTF16(extension->name());
554 } 555 }
555 #endif 556 #endif
556 557
557 return base::string16(); 558 return base::string16();
558 } 559 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698