#ifndef CONTENT_RENDERER_NOTIFICATION_PROVIDER_H_
#define CONTENT_RENDERER_NOTIFICATION_PROVIDER_H_
#include "content/public/renderer/render_view_observer.h"
#include "content/renderer/active_notification_tracker.h"
#include "third_party/WebKit/public/web/WebNotification.h"
#include "third_party/WebKit/public/web/WebNotificationPresenter.h"
namespace blink {
class WebNotificationPermissionCallback;
}
namespace content {
class RenderViewImpl;
class NotificationProvider : public RenderViewObserver,
public blink::WebNotificationPresenter {
public:
explicit NotificationProvider(RenderViewImpl* render_view);
virtual ~NotificationProvider();
private:
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
virtual bool show(const blink::WebNotification& proxy);
virtual void cancel(const blink::WebNotification& proxy);
virtual void objectDestroyed(const blink::WebNotification& proxy);
virtual blink::WebNotificationPresenter::Permission checkPermission(
const blink::WebSecurityOrigin& origin);
virtual void requestPermission(const blink::WebSecurityOrigin& origin,
blink::WebNotificationPermissionCallback* callback);
void OnDisplay(int id);
void OnError(int id, const blink::WebString& message);
void OnClose(int id, bool by_user);
void OnClick(int id);
void OnPermissionRequestComplete(int id);
void OnNavigate();
ActiveNotificationTracker manager_;
DISALLOW_COPY_AND_ASSIGN(NotificationProvider);
};
}
#endif