| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 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 CONTENT_BROWSER_NOTIFICATIONS_BLINK_NOTIFICATION_SERVICE_IMPL_H_ |
| 6 #define CONTENT_BROWSER_NOTIFICATIONS_BLINK_NOTIFICATION_SERVICE_IMPL_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "mojo/public/cpp/bindings/binding.h" |
| 10 #include "mojo/public/cpp/bindings/interface_request.h" |
| 11 #include "third_party/WebKit/public/platform/modules/notifications/notification_
service.mojom.h" |
| 12 |
| 13 namespace content { |
| 14 |
| 15 class PlatformNotificationContextImpl; |
| 16 class ResourceContext; |
| 17 |
| 18 // Implementation of the NotificationService used for Web Notifications. Is |
| 19 // responsible for displaying, updating and reading of both non-persistent |
| 20 // and persistent notifications. Lives on the IO thread. |
| 21 class BlinkNotificationServiceImpl : public blink::mojom::NotificationService { |
| 22 public: |
| 23 BlinkNotificationServiceImpl( |
| 24 PlatformNotificationContextImpl* notification_context, |
| 25 ResourceContext* resource_context, |
| 26 int render_process_id, |
| 27 mojo::InterfaceRequest<blink::mojom::NotificationService> request); |
| 28 ~BlinkNotificationServiceImpl() override; |
| 29 |
| 30 // blink::mojom::NotificationService implementation. |
| 31 void GetPermissionStatus( |
| 32 const mojo::String& origin, |
| 33 const GetPermissionStatusCallback& callback) override; |
| 34 |
| 35 private: |
| 36 // Called when an error is detected on binding_. |
| 37 void OnConnectionError(); |
| 38 |
| 39 // The notification context that owns this service instance. |
| 40 PlatformNotificationContextImpl* notification_context_; |
| 41 |
| 42 ResourceContext* resource_context_; |
| 43 |
| 44 int render_process_id_; |
| 45 |
| 46 mojo::Binding<blink::mojom::NotificationService> binding_; |
| 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(BlinkNotificationServiceImpl); |
| 49 }; |
| 50 |
| 51 } // namespace content |
| 52 |
| 53 #endif // CONTENT_BROWSER_NOTIFICATIONS_BLINK_NOTIFICATION_SERVICE_IMPL_H_ |
| OLD | NEW |