OLD | NEW |
| (Empty) |
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 | |
11 class GURL; | |
12 struct DesktopNotificationHostMsg_Show_Params; | |
13 | |
14 // Per-tab Desktop notification handler. Handles desktop notification IPCs | |
15 // coming in from the renderer. | |
16 class DesktopNotificationHandler : public RenderViewHostObserver { | |
17 public: | |
18 static DesktopNotificationHandler* Create(RenderViewHost* render_view_host); | |
19 virtual ~DesktopNotificationHandler(); | |
20 | |
21 private: | |
22 explicit DesktopNotificationHandler(RenderViewHost* render_view_host); | |
23 | |
24 // RenderViewHostObserver implementation. | |
25 virtual bool OnMessageReceived(const IPC::Message& message); | |
26 | |
27 // IPC handlers. | |
28 void OnShow(const DesktopNotificationHostMsg_Show_Params& params); | |
29 void OnCancel(int notification_id); | |
30 void OnRequestPermission(const GURL& origin, int callback_id); | |
31 | |
32 private: | |
33 DISALLOW_COPY_AND_ASSIGN(DesktopNotificationHandler); | |
34 }; | |
35 | |
36 #endif // CHROME_BROWSER_DESKTOP_NOTIFICATION_HANDLER_H_ | |
37 | |
OLD | NEW |