| 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_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_PUSH_MESSAGING_SERVICE_H_ | 5 #ifndef CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_PUSH_MESSAGING_SERVICE_H_ |
| 6 #define CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_PUSH_MESSAGING_SERVICE_H_ | 6 #define CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_PUSH_MESSAGING_SERVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> |
| 9 | 10 |
| 10 #include "content/public/browser/push_messaging_service.h" | 11 #include "content/public/browser/push_messaging_service.h" |
| 11 #include "content/public/common/push_messaging_status.h" | 12 #include "content/public/common/push_messaging_status.h" |
| 12 #include "third_party/WebKit/public/platform/WebPushPermissionStatus.h" | 13 #include "third_party/WebKit/public/platform/WebPushPermissionStatus.h" |
| 13 | 14 |
| 14 namespace content { | 15 namespace content { |
| 15 | 16 |
| 16 class LayoutTestPushMessagingService : public PushMessagingService { | 17 class LayoutTestPushMessagingService : public PushMessagingService { |
| 17 public: | 18 public: |
| 18 LayoutTestPushMessagingService(); | 19 LayoutTestPushMessagingService(); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 38 const PushMessagingService::RegisterCallback& callback) override; | 39 const PushMessagingService::RegisterCallback& callback) override; |
| 39 // TODO(mvanouwerkerk): Delete once the Push API flows through platform. | 40 // TODO(mvanouwerkerk): Delete once the Push API flows through platform. |
| 40 // https://crbug.com/389194 | 41 // https://crbug.com/389194 |
| 41 blink::WebPushPermissionStatus GetPermissionStatus( | 42 blink::WebPushPermissionStatus GetPermissionStatus( |
| 42 const GURL& requesting_origin, | 43 const GURL& requesting_origin, |
| 43 int renderer_id, | 44 int renderer_id, |
| 44 int render_frame_id) override; | 45 int render_frame_id) override; |
| 45 blink::WebPushPermissionStatus GetPermissionStatus( | 46 blink::WebPushPermissionStatus GetPermissionStatus( |
| 46 const GURL& requesting_origin, | 47 const GURL& requesting_origin, |
| 47 const GURL& embedding_origin) override; | 48 const GURL& embedding_origin) override; |
| 49 void Unregister(const GURL& requesting_origin, |
| 50 int64 service_worker_registration_id, |
| 51 const UnregisterCallback& callback) override; |
| 48 | 52 |
| 49 private: | 53 private: |
| 50 // Map from origin to permission status. | 54 // Map from origin to permission status. |
| 51 std::map<GURL, blink::WebPushPermissionStatus> permission_map_; | 55 std::map<GURL, blink::WebPushPermissionStatus> permission_map_; |
| 56 // Set of currently registered origins. |
| 57 std::set<GURL> registrations_; |
| 52 | 58 |
| 53 DISALLOW_COPY_AND_ASSIGN(LayoutTestPushMessagingService); | 59 DISALLOW_COPY_AND_ASSIGN(LayoutTestPushMessagingService); |
| 54 }; | 60 }; |
| 55 | 61 |
| 56 } // namespace content | 62 } // namespace content |
| 57 | 63 |
| 58 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_PUSH_MESSAGING_SERVICE_
H_ | 64 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_PUSH_MESSAGING_SERVICE_
H_ |
| OLD | NEW |