| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 explicit NotificationPermissionDispatcher(RenderFrame* render_frame); | 26 explicit NotificationPermissionDispatcher(RenderFrame* render_frame); |
| 27 ~NotificationPermissionDispatcher() override; | 27 ~NotificationPermissionDispatcher() override; |
| 28 | 28 |
| 29 // Requests permission to display Web Notifications for |origin|. The callback | 29 // Requests permission to display Web Notifications for |origin|. The callback |
| 30 // will be invoked when the permission status is available. This class will | 30 // will be invoked when the permission status is available. This class will |
| 31 // take ownership of |callback|. | 31 // take ownership of |callback|. |
| 32 void RequestPermission(const blink::WebSecurityOrigin& origin, | 32 void RequestPermission(const blink::WebSecurityOrigin& origin, |
| 33 blink::WebNotificationPermissionCallback* callback); | 33 blink::WebNotificationPermissionCallback* callback); |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 // RenderFrameObserver implementation. |
| 37 void OnDestruct() override; |
| 38 |
| 36 void OnPermissionRequestComplete( | 39 void OnPermissionRequestComplete( |
| 37 std::unique_ptr<blink::WebNotificationPermissionCallback> callback, | 40 std::unique_ptr<blink::WebNotificationPermissionCallback> callback, |
| 38 blink::mojom::PermissionStatus status); | 41 blink::mojom::PermissionStatus status); |
| 39 | 42 |
| 40 blink::mojom::PermissionServicePtr permission_service_; | 43 blink::mojom::PermissionServicePtr permission_service_; |
| 41 | 44 |
| 42 DISALLOW_COPY_AND_ASSIGN(NotificationPermissionDispatcher); | 45 DISALLOW_COPY_AND_ASSIGN(NotificationPermissionDispatcher); |
| 43 }; | 46 }; |
| 44 | 47 |
| 45 } // namespace content | 48 } // namespace content |
| 46 | 49 |
| 47 #endif // CONTENT_RENDERER_NOTIFICATION_PERMISSION_DISPATCHER_H_ | 50 #endif // CONTENT_RENDERER_NOTIFICATION_PERMISSION_DISPATCHER_H_ |
| OLD | NEW |