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

Side by Side Diff: content/renderer/notification_provider.cc

Issue 7242014: Update src/content/renderer to reflect WEBKIT_FRAME_TO_DOCUMENT_API_MOVE (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "content/renderer/notification_provider.h" 5 #include "content/renderer/notification_provider.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/task.h" 8 #include "base/task.h"
9 #include "content/common/desktop_notification_messages.h" 9 #include "content/common/desktop_notification_messages.h"
10 #include "content/common/view_messages.h" 10 #include "content/common/view_messages.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 if (message.type() == ViewMsg_Navigate::ID) 95 if (message.type() == ViewMsg_Navigate::ID)
96 OnNavigate(); // Don't want to swallow the message. 96 OnNavigate(); // Don't want to swallow the message.
97 97
98 return handled; 98 return handled;
99 } 99 }
100 100
101 bool NotificationProvider::ShowHTML(const WebNotification& notification, 101 bool NotificationProvider::ShowHTML(const WebNotification& notification,
102 int id) { 102 int id) {
103 DCHECK(notification.isHTML()); 103 DCHECK(notification.isHTML());
104 DesktopNotificationHostMsg_Show_Params params; 104 DesktopNotificationHostMsg_Show_Params params;
105 params.origin = 105 WebDocument document = render_view()->webview()->mainFrame()->document();
106 GURL(render_view()->webview()->mainFrame()->url()).GetOrigin(); 106 params.origin = GURL(document.securityOrigin().toString());
107 params.is_html = true; 107 params.is_html = true;
108 params.contents_url = notification.url(); 108 params.contents_url = notification.url();
109 params.notification_id = id; 109 params.notification_id = id;
110 params.replace_id = notification.replaceId(); 110 params.replace_id = notification.replaceId();
111 return Send(new DesktopNotificationHostMsg_Show(routing_id(), params)); 111 return Send(new DesktopNotificationHostMsg_Show(routing_id(), params));
112 } 112 }
113 113
114 bool NotificationProvider::ShowText(const WebNotification& notification, 114 bool NotificationProvider::ShowText(const WebNotification& notification,
115 int id) { 115 int id) {
116 DCHECK(!notification.isHTML()); 116 DCHECK(!notification.isHTML());
117 DesktopNotificationHostMsg_Show_Params params; 117 DesktopNotificationHostMsg_Show_Params params;
118 params.is_html = false; 118 params.is_html = false;
119 params.origin = GURL( 119 WebDocument document = render_view()->webview()->mainFrame()->document();
120 render_view()->webview()->mainFrame()->url()).GetOrigin(); 120 params.origin = GURL(document.securityOrigin().toString());
121 params.icon_url = notification.iconURL(); 121 params.icon_url = notification.iconURL();
122 params.title = notification.title(); 122 params.title = notification.title();
123 params.body = notification.body(); 123 params.body = notification.body();
124 params.direction = notification.direction(); 124 params.direction = notification.direction();
125 params.notification_id = id; 125 params.notification_id = id;
126 params.replace_id = notification.replaceId(); 126 params.replace_id = notification.replaceId();
127 return Send(new DesktopNotificationHostMsg_Show(routing_id(), params)); 127 return Send(new DesktopNotificationHostMsg_Show(routing_id(), params));
128 } 128 }
129 129
130 void NotificationProvider::OnDisplay(int id) { 130 void NotificationProvider::OnDisplay(int id) {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 void NotificationProvider::OnPermissionRequestComplete(int id) { 168 void NotificationProvider::OnPermissionRequestComplete(int id) {
169 WebNotificationPermissionCallback* callback = manager_.GetCallback(id); 169 WebNotificationPermissionCallback* callback = manager_.GetCallback(id);
170 DCHECK(callback); 170 DCHECK(callback);
171 callback->permissionRequestComplete(); 171 callback->permissionRequestComplete();
172 manager_.OnPermissionRequestComplete(id); 172 manager_.OnPermissionRequestComplete(id);
173 } 173 }
174 174
175 void NotificationProvider::OnNavigate() { 175 void NotificationProvider::OnNavigate() {
176 manager_.Clear(); 176 manager_.Clear();
177 } 177 }
OLDNEW
« no previous file with comments | « content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc ('k') | content/renderer/render_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698