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

Unified Diff: chrome/renderer/notification_provider.h

Issue 276032: Refactor notification provider in renderer process to not use a message filte... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | « no previous file | chrome/renderer/notification_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/notification_provider.h
===================================================================
--- chrome/renderer/notification_provider.h (revision 28967)
+++ chrome/renderer/notification_provider.h (working copy)
@@ -9,7 +9,6 @@
#include "chrome/common/desktop_notifications/active_notification_tracker.h"
#include "ipc/ipc_channel.h"
-#include "ipc/ipc_channel_proxy.h"
#include "webkit/api/public/WebNotification.h"
#include "webkit/api/public/WebNotificationPresenter.h"
@@ -18,14 +17,14 @@
class WebNotificationPermissionCallback;
}
-class NotificationProvider : public WebKit::WebNotificationPresenter,
- public IPC::ChannelProxy::MessageFilter {
+// NotificationProvider class is owned by the RenderView. Only
+// to be used on the UI thread.
+class NotificationProvider : public WebKit::WebNotificationPresenter {
public:
explicit NotificationProvider(RenderView* view);
~NotificationProvider() {}
- // WebKit::WebNotificationPresenter interface. Called from WebKit
- // on the UI thread.
+ // WebKit::WebNotificationPresenter interface.
virtual bool show(const WebKit::WebNotification& proxy);
virtual void cancel(const WebKit::WebNotification& proxy);
virtual void objectDestroyed(const WebKit::WebNotification& proxy);
@@ -34,26 +33,20 @@
virtual void requestPermission(const WebKit::WebString& origin,
WebKit::WebNotificationPermissionCallback* callback);
-private:
- // Internal methods used on the UI thread.
+ // IPC message handler called from RenderView.
+ bool OnMessageReceived(const IPC::Message& message);
+
+ private:
+ // Internal methods used to show notifications.
bool ShowHTML(const WebKit::WebNotification& notification, int id);
bool ShowText(const WebKit::WebNotification& notification, int id);
- // Callback methods invoked when events happen on active notifications.
+ // IPC handlers.
void OnDisplay(int id);
void OnError(int id, const WebKit::WebString& message);
void OnClose(int id, bool by_user);
void OnPermissionRequestComplete(int id);
- // Internal versions of the IPC handlers which run on the UI thread.
- void HandleOnDisplay(int id);
- void HandleOnError(int id, const WebKit::WebString& message);
- void HandleOnClose(int id, bool by_user);
- void HandleOnPermissionRequestComplete(int id);
-
- // IPC::ChannelProxy::MessageFilter override
- virtual bool OnMessageReceived(const IPC::Message& message);
-
bool Send(IPC::Message* message);
// Non-owned pointer to the RenderView object which created and owns
« no previous file with comments | « no previous file | chrome/renderer/notification_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698