Chromium Code Reviews| 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/WebPushPermissionCallback.h" | |
| 14 | 15 |
| 15 class Profile; | 16 class Profile; |
| 16 | 17 |
| 18 typedef blink::WebPushPermissionCallback::PushPermissionStatus | |
|
Michael van Ouwerkerk
2014/10/20 16:30:07
That's a weird way of pulling in an enum. It shoul
Miguel Garcia
2014/10/22 16:35:27
Done.
| |
| 19 PushPermissionStatus; | |
| 20 | |
| 17 namespace user_prefs { | 21 namespace user_prefs { |
| 18 class PrefRegistrySyncable; | 22 class PrefRegistrySyncable; |
| 19 } | 23 } |
| 20 | 24 |
| 21 namespace gcm { | 25 namespace gcm { |
| 22 | 26 |
| 23 class GCMProfileService; | 27 class GCMProfileService; |
| 24 struct PushMessagingApplicationId; | 28 struct PushMessagingApplicationId; |
| 25 | 29 |
| 26 class PushMessagingServiceImpl : public content::PushMessagingService, | 30 class PushMessagingServiceImpl : public content::PushMessagingService, |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 50 | 54 |
| 51 // content::PushMessagingService implementation: | 55 // content::PushMessagingService implementation: |
| 52 virtual void Register( | 56 virtual void Register( |
| 53 const GURL& origin, | 57 const GURL& origin, |
| 54 int64 service_worker_registration_id, | 58 int64 service_worker_registration_id, |
| 55 const std::string& sender_id, | 59 const std::string& sender_id, |
| 56 int renderer_id, | 60 int renderer_id, |
| 57 int render_frame_id, | 61 int render_frame_id, |
| 58 bool user_gesture, | 62 bool user_gesture, |
| 59 const content::PushMessagingService::RegisterCallback& callback) override; | 63 const content::PushMessagingService::RegisterCallback& callback) override; |
| 64 virtual PushPermissionStatus PermissionStatus( | |
|
Michael van Ouwerkerk
2014/10/20 16:30:08
This method should be be named as a verb e.g. GetP
| |
| 65 const GURL& requesting_origin, int renderer_id, | |
| 66 int render_frame_id) override; | |
| 60 | 67 |
| 61 private: | 68 private: |
| 62 void DeliverMessageCallback(const PushMessagingApplicationId& application_id, | 69 void DeliverMessageCallback(const PushMessagingApplicationId& application_id, |
| 63 const GCMClient::IncomingMessage& message, | 70 const GCMClient::IncomingMessage& message, |
| 64 content::PushMessagingStatus status); | 71 content::PushMessagingStatus status); |
| 65 | 72 |
| 66 void RegisterEnd( | 73 void RegisterEnd( |
| 67 const content::PushMessagingService::RegisterCallback& callback, | 74 const content::PushMessagingService::RegisterCallback& callback, |
| 68 const std::string& registration_id, | 75 const std::string& registration_id, |
| 69 content::PushMessagingStatus status); | 76 content::PushMessagingStatus status); |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 84 Profile* profile_; // It owns our owner. | 91 Profile* profile_; // It owns our owner. |
| 85 | 92 |
| 86 base::WeakPtrFactory<PushMessagingServiceImpl> weak_factory_; | 93 base::WeakPtrFactory<PushMessagingServiceImpl> weak_factory_; |
| 87 | 94 |
| 88 DISALLOW_COPY_AND_ASSIGN(PushMessagingServiceImpl); | 95 DISALLOW_COPY_AND_ASSIGN(PushMessagingServiceImpl); |
| 89 }; | 96 }; |
| 90 | 97 |
| 91 } // namespace gcm | 98 } // namespace gcm |
| 92 | 99 |
| 93 #endif // CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_SERVICE_IMPL_H_ | 100 #endif // CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_SERVICE_IMPL_H_ |
| OLD | NEW |