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

Unified Diff: chrome/renderer/notification_provider.h

Issue 6151011: Introduce RenderView::Observer interface so that RenderView doesn't have to k... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | « chrome/renderer/geolocation_dispatcher.cc ('k') | 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 71253)
+++ chrome/renderer/notification_provider.h (working copy)
@@ -7,23 +7,26 @@
#pragma once
#include "chrome/common/desktop_notifications/active_notification_tracker.h"
-#include "ipc/ipc_channel.h"
+#include "chrome/renderer/render_view_observer.h"
#include "third_party/WebKit/WebKit/chromium/public/WebNotification.h"
#include "third_party/WebKit/WebKit/chromium/public/WebNotificationPresenter.h"
-class RenderView;
namespace WebKit {
class WebNotificationPermissionCallback;
}
// NotificationProvider class is owned by the RenderView. Only
-// to be used on the UI thread.
-class NotificationProvider : public WebKit::WebNotificationPresenter,
- public IPC::Channel::Listener {
+// to be used on the main thread.
+class NotificationProvider : public RenderViewObserver,
+ public WebKit::WebNotificationPresenter {
public:
- explicit NotificationProvider(RenderView* view);
+ explicit NotificationProvider(RenderView* render_view);
virtual ~NotificationProvider();
+ private:
+ // RenderView::Observer implementation.
+ bool OnMessageReceived(const IPC::Message& message);
+
// WebKit::WebNotificationPresenter interface.
virtual bool show(const WebKit::WebNotification& proxy);
virtual void cancel(const WebKit::WebNotification& proxy);
@@ -33,13 +36,6 @@
virtual void requestPermission(const WebKit::WebSecurityOrigin& origin,
WebKit::WebNotificationPermissionCallback* callback);
- // IPC::Channel::Listener implementation.
- bool OnMessageReceived(const IPC::Message& message);
-
- // Called when the RenderView navigates.
- void OnNavigate();
-
- private:
// Internal methods used to show notifications.
bool ShowHTML(const WebKit::WebNotification& notification, int id);
bool ShowText(const WebKit::WebNotification& notification, int id);
@@ -50,13 +46,8 @@
void OnClose(int id, bool by_user);
void OnClick(int id);
void OnPermissionRequestComplete(int id);
+ void OnNavigate();
- bool Send(IPC::Message* message);
-
- // Non-owned pointer to the RenderView object which created and owns
- // this object.
- RenderView* view_;
-
// A tracker object which manages the active notifications and the IDs
// that are used to refer to them over IPC.
ActiveNotificationTracker manager_;
« no previous file with comments | « chrome/renderer/geolocation_dispatcher.cc ('k') | chrome/renderer/notification_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698