summaryrefslogtreecommitdiffstats
path: root/content/renderer/notification_provider.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-19 18:03:30 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-19 18:03:30 +0000
commite7c21b81e038b600c4a39a8c0f9e92ed6a6612c6 (patch)
tree6f0bcf6afa6862b279b1fc1d23d78cead2bd0de3 /content/renderer/notification_provider.cc
parent903226b51dbba87492e2dac5405f82f5b3947f6d (diff)
downloadchromium_src-e7c21b81e038b600c4a39a8c0f9e92ed6a6612c6.zip
chromium_src-e7c21b81e038b600c4a39a8c0f9e92ed6a6612c6.tar.gz
chromium_src-e7c21b81e038b600c4a39a8c0f9e92ed6a6612c6.tar.bz2
Move geolocation, desktop notification, and device orientation into their own message files.Also fix a regression from my earlier change to create a plugin through the embedder API. The fix is to not to create a plugin if the embedder returns NULL, and just have the default implementation create the plugin on its own.TBR=avi
R=brettw@chromium.org,johnnyg@chromium.org,darin@chromium.org,*,jam@chromium.org,ben@chromium.org Review URL: http://codereview.chromium.org/6688054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78832 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/notification_provider.cc')
-rw-r--r--content/renderer/notification_provider.cc31
1 files changed, 15 insertions, 16 deletions
diff --git a/content/renderer/notification_provider.cc b/content/renderer/notification_provider.cc
index 816f4ca..5beb8e1 100644
--- a/content/renderer/notification_provider.cc
+++ b/content/renderer/notification_provider.cc
@@ -6,10 +6,10 @@
#include "base/string_util.h"
#include "base/task.h"
-#include "chrome/common/render_messages.h"
-#include "chrome/common/render_messages_params.h"
#include "chrome/common/url_constants.h"
+#include "chrome/common/render_messages.h"
#include "chrome/renderer/render_thread.h"
+#include "content/common/desktop_notification_messages.h"
#include "content/renderer/render_view.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
@@ -46,7 +46,7 @@ void NotificationProvider::cancel(const WebNotification& notification) {
bool id_found = manager_.GetId(notification, id);
// Won't be found if the notification has already been closed by the user.
if (id_found)
- Send(new ViewHostMsg_CancelDesktopNotification(routing_id(), id));
+ Send(new DesktopNotificationHostMsg_Cancel(routing_id(), id));
}
void NotificationProvider::objectDestroyed(
@@ -61,7 +61,7 @@ void NotificationProvider::objectDestroyed(
WebNotificationPresenter::Permission NotificationProvider::checkPermission(
const WebURL& url) {
int permission;
- Send(new ViewHostMsg_CheckNotificationPermission(
+ Send(new DesktopNotificationHostMsg_CheckPermission(
routing_id(),
url,
&permission));
@@ -77,19 +77,18 @@ void NotificationProvider::requestPermission(
int id = manager_.RegisterPermissionRequest(callback);
- Send(new ViewHostMsg_RequestNotificationPermission(routing_id(),
- GURL(origin.toString()),
- id));
+ Send(new DesktopNotificationHostMsg_RequestPermission(
+ routing_id(), GURL(origin.toString()), id));
}
bool NotificationProvider::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(NotificationProvider, message)
- IPC_MESSAGE_HANDLER(ViewMsg_PostDisplayToNotificationObject, OnDisplay);
- IPC_MESSAGE_HANDLER(ViewMsg_PostErrorToNotificationObject, OnError);
- IPC_MESSAGE_HANDLER(ViewMsg_PostCloseToNotificationObject, OnClose);
- IPC_MESSAGE_HANDLER(ViewMsg_PostClickToNotificationObject, OnClick);
- IPC_MESSAGE_HANDLER(ViewMsg_PermissionRequestDone,
+ IPC_MESSAGE_HANDLER(DesktopNotificationMsg_PostDisplay, OnDisplay);
+ IPC_MESSAGE_HANDLER(DesktopNotificationMsg_PostError, OnError);
+ IPC_MESSAGE_HANDLER(DesktopNotificationMsg_PostClose, OnClose);
+ IPC_MESSAGE_HANDLER(DesktopNotificationMsg_PostClick, OnClick);
+ IPC_MESSAGE_HANDLER(DesktopNotificationMsg_PermissionRequestDone,
OnPermissionRequestComplete);
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -112,20 +111,20 @@ bool NotificationProvider::ShowHTML(const WebNotification& notification,
return false;
DCHECK(notification.isHTML());
- ViewHostMsg_ShowNotification_Params params;
+ DesktopNotificationHostMsg_Show_Params params;
params.origin =
GURL(render_view()->webview()->mainFrame()->url()).GetOrigin();
params.is_html = true;
params.contents_url = notification.url();
params.notification_id = id;
params.replace_id = notification.replaceId();
- return Send(new ViewHostMsg_ShowDesktopNotification(routing_id(), params));
+ return Send(new DesktopNotificationHostMsg_Show(routing_id(), params));
}
bool NotificationProvider::ShowText(const WebNotification& notification,
int id) {
DCHECK(!notification.isHTML());
- ViewHostMsg_ShowNotification_Params params;
+ DesktopNotificationHostMsg_Show_Params params;
params.is_html = false;
params.origin = GURL(
render_view()->webview()->mainFrame()->url()).GetOrigin();
@@ -135,7 +134,7 @@ bool NotificationProvider::ShowText(const WebNotification& notification,
params.direction = notification.direction();
params.notification_id = id;
params.replace_id = notification.replaceId();
- return Send(new ViewHostMsg_ShowDesktopNotification(routing_id(), params));
+ return Send(new DesktopNotificationHostMsg_Show(routing_id(), params));
}
void NotificationProvider::OnDisplay(int id) {