| Index: content/renderer/notification_provider.cc
|
| diff --git a/content/renderer/notification_provider.cc b/content/renderer/notification_provider.cc
|
| index 687eceb5b54df08432b8bba71604bfdb95c30e68..07b5241aec615192c602de22356566c6e52bbbbc 100644
|
| --- a/content/renderer/notification_provider.cc
|
| +++ b/content/renderer/notification_provider.cc
|
| @@ -35,11 +35,18 @@ NotificationProvider::~NotificationProvider() {
|
| }
|
|
|
| bool NotificationProvider::show(const WebNotification& notification) {
|
| + WebDocument document = render_view()->GetWebView()->mainFrame()->document();
|
| int notification_id = manager_.RegisterNotification(notification);
|
| - if (notification.isHTML())
|
| - return ShowHTML(notification, notification_id);
|
| - else
|
| - return ShowText(notification, notification_id);
|
| +
|
| + ShowDesktopNotificationHostMsgParams params;
|
| + params.origin = GURL(document.securityOrigin().toString());
|
| + params.icon_url = notification.iconURL();
|
| + params.title = notification.title();
|
| + params.body = notification.body();
|
| + params.direction = notification.direction();
|
| + params.notification_id = notification_id;
|
| + params.replace_id = notification.replaceId();
|
| + return Send(new DesktopNotificationHostMsg_Show(routing_id(), params));
|
| }
|
|
|
| void NotificationProvider::cancel(const WebNotification& notification) {
|
| @@ -100,35 +107,6 @@ bool NotificationProvider::OnMessageReceived(const IPC::Message& message) {
|
| return handled;
|
| }
|
|
|
| -bool NotificationProvider::ShowHTML(const WebNotification& notification,
|
| - int id) {
|
| - DCHECK(notification.isHTML());
|
| - ShowDesktopNotificationHostMsgParams params;
|
| - WebDocument document = render_view()->GetWebView()->mainFrame()->document();
|
| - params.origin = GURL(document.securityOrigin().toString());
|
| - params.is_html = true;
|
| - params.contents_url = notification.url();
|
| - params.notification_id = id;
|
| - params.replace_id = notification.replaceId();
|
| - return Send(new DesktopNotificationHostMsg_Show(routing_id(), params));
|
| -}
|
| -
|
| -bool NotificationProvider::ShowText(const WebNotification& notification,
|
| - int id) {
|
| - DCHECK(!notification.isHTML());
|
| - ShowDesktopNotificationHostMsgParams params;
|
| - params.is_html = false;
|
| - WebDocument document = render_view()->GetWebView()->mainFrame()->document();
|
| - params.origin = GURL(document.securityOrigin().toString());
|
| - params.icon_url = notification.iconURL();
|
| - params.title = notification.title();
|
| - params.body = notification.body();
|
| - params.direction = notification.direction();
|
| - params.notification_id = id;
|
| - params.replace_id = notification.replaceId();
|
| - return Send(new DesktopNotificationHostMsg_Show(routing_id(), params));
|
| -}
|
| -
|
| void NotificationProvider::OnDisplay(int id) {
|
| WebNotification notification;
|
| bool found = manager_.GetNotification(id, ¬ification);
|
|
|