desktop_notification_handler.h revision ddb351dbec246cf1fab5ec20d2d5520909041de1
1// Copyright (c) 2011 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_
6#define CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_
7#pragma once
8
9#include "content/browser/renderer_host/render_view_host_observer.h"
10
11class GURL;
12struct DesktopNotificationHostMsg_Show_Params;
13
14// Per-tab Desktop notification handler. Handles desktop notification IPCs
15// coming in from the renderer.
16class DesktopNotificationHandler : public RenderViewHostObserver {
17 public:
18  explicit DesktopNotificationHandler(RenderViewHost* render_view_host);
19  virtual ~DesktopNotificationHandler();
20
21 private:
22  // RenderViewHostObserver implementation.
23  virtual bool OnMessageReceived(const IPC::Message& message);
24
25  // IPC handlers.
26  void OnShow(const DesktopNotificationHostMsg_Show_Params& params);
27  void OnCancel(int notification_id);
28  void OnRequestPermission(const GURL& origin, int callback_id);
29
30 private:
31  DISALLOW_COPY_AND_ASSIGN(DesktopNotificationHandler);
32};
33
34#endif  // CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_
35
36