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 CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_SERVICE_IMPL_H_ | 5 #ifndef CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_SERVICE_IMPL_H_ |
6 #define CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_SERVICE_IMPL_H_ | 6 #define CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_SERVICE_IMPL_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "components/gcm_driver/gcm_app_handler.h" | 10 #include "components/gcm_driver/gcm_app_handler.h" |
11 #include "components/gcm_driver/gcm_client.h" | 11 #include "components/gcm_driver/gcm_client.h" |
12 #include "content/public/browser/push_messaging_service.h" | 12 #include "content/public/browser/push_messaging_service.h" |
13 #include "content/public/common/push_messaging_status.h" | 13 #include "content/public/common/push_messaging_status.h" |
| 14 #include "third_party/WebKit/public/platform/WebPushPermissionStatus.h" |
14 | 15 |
15 class Profile; | 16 class Profile; |
16 | 17 |
17 namespace user_prefs { | 18 namespace user_prefs { |
18 class PrefRegistrySyncable; | 19 class PrefRegistrySyncable; |
19 } | 20 } |
20 | 21 |
21 namespace gcm { | 22 namespace gcm { |
22 | 23 |
23 class GCMProfileService; | 24 class GCMProfileService; |
(...skipping 26 matching lines...) Expand all Loading... |
50 | 51 |
51 // content::PushMessagingService implementation: | 52 // content::PushMessagingService implementation: |
52 void Register( | 53 void Register( |
53 const GURL& origin, | 54 const GURL& origin, |
54 int64 service_worker_registration_id, | 55 int64 service_worker_registration_id, |
55 const std::string& sender_id, | 56 const std::string& sender_id, |
56 int renderer_id, | 57 int renderer_id, |
57 int render_frame_id, | 58 int render_frame_id, |
58 bool user_gesture, | 59 bool user_gesture, |
59 const content::PushMessagingService::RegisterCallback& callback) override; | 60 const content::PushMessagingService::RegisterCallback& callback) override; |
| 61 blink::WebPushPermissionStatus GetPermissionStatus( |
| 62 const GURL& requesting_origin, |
| 63 int renderer_id, |
| 64 int render_frame_id) override; |
60 | 65 |
61 void SetProfileForTesting(Profile* profile); | 66 void SetProfileForTesting(Profile* profile); |
62 | 67 |
63 private: | 68 private: |
64 void DeliverMessageCallback(const PushMessagingApplicationId& application_id, | 69 void DeliverMessageCallback(const PushMessagingApplicationId& application_id, |
65 const GCMClient::IncomingMessage& message, | 70 const GCMClient::IncomingMessage& message, |
66 content::PushDeliveryStatus status); | 71 content::PushDeliveryStatus status); |
67 | 72 |
68 void RegisterEnd( | 73 void RegisterEnd( |
69 const content::PushMessagingService::RegisterCallback& callback, | 74 const content::PushMessagingService::RegisterCallback& callback, |
(...skipping 16 matching lines...) Expand all Loading... |
86 Profile* profile_; // It owns our owner. | 91 Profile* profile_; // It owns our owner. |
87 | 92 |
88 base::WeakPtrFactory<PushMessagingServiceImpl> weak_factory_; | 93 base::WeakPtrFactory<PushMessagingServiceImpl> weak_factory_; |
89 | 94 |
90 DISALLOW_COPY_AND_ASSIGN(PushMessagingServiceImpl); | 95 DISALLOW_COPY_AND_ASSIGN(PushMessagingServiceImpl); |
91 }; | 96 }; |
92 | 97 |
93 } // namespace gcm | 98 } // namespace gcm |
94 | 99 |
95 #endif // CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_SERVICE_IMPL_H_ | 100 #endif // CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_SERVICE_IMPL_H_ |
OLD | NEW |