OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_NOTIFICATION_PERMISSION_DISPATCHER_H_ | 5 #ifndef CONTENT_RENDERER_NOTIFICATION_PERMISSION_DISPATCHER_H_ |
6 #define CONTENT_RENDERER_NOTIFICATION_PERMISSION_DISPATCHER_H_ | 6 #define CONTENT_RENDERER_NOTIFICATION_PERMISSION_DISPATCHER_H_ |
7 | 7 |
8 #include "base/id_map.h" | 8 #include "base/id_map.h" |
9 #include "content/public/renderer/render_frame_observer.h" | 9 #include "content/public/renderer/render_frame_observer.h" |
10 #include "ipc/ipc_message.h" | 10 #include "ipc/ipc_message.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 // Requests permission to display Web Notifications for |origin|. The callback | 26 // Requests permission to display Web Notifications for |origin|. The callback |
27 // will be invoked when the permission status is available. This class will | 27 // will be invoked when the permission status is available. This class will |
28 // take ownership of |callback|. | 28 // take ownership of |callback|. |
29 void RequestPermission( | 29 void RequestPermission( |
30 const blink::WebSecurityOrigin& origin, | 30 const blink::WebSecurityOrigin& origin, |
31 blink::WebNotificationPermissionCallback* callback); | 31 blink::WebNotificationPermissionCallback* callback); |
32 | 32 |
33 private: | 33 private: |
34 // RenderFrameObserver implementation. | 34 // RenderFrameObserver implementation. |
35 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 35 virtual bool OnMessageReceived(const IPC::Message& message) override; |
36 | 36 |
37 void OnPermissionRequestComplete( | 37 void OnPermissionRequestComplete( |
38 int request_id, blink::WebNotificationPermission result); | 38 int request_id, blink::WebNotificationPermission result); |
39 | 39 |
40 // Tracks the active notification permission requests. This class takes | 40 // Tracks the active notification permission requests. This class takes |
41 // ownership of the created WebNotificationPermissionCallback objects. | 41 // ownership of the created WebNotificationPermissionCallback objects. |
42 IDMap<blink::WebNotificationPermissionCallback, IDMapOwnPointer> | 42 IDMap<blink::WebNotificationPermissionCallback, IDMapOwnPointer> |
43 pending_requests_; | 43 pending_requests_; |
44 | 44 |
45 DISALLOW_COPY_AND_ASSIGN(NotificationPermissionDispatcher); | 45 DISALLOW_COPY_AND_ASSIGN(NotificationPermissionDispatcher); |
46 }; | 46 }; |
47 | 47 |
48 } // namespace content | 48 } // namespace content |
49 | 49 |
50 #endif // CONTENT_RENDERER_NOTIFICATION_PERMISSION_DISPATCHER_H_ | 50 #endif // CONTENT_RENDERER_NOTIFICATION_PERMISSION_DISPATCHER_H_ |
OLD | NEW |