| 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" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 virtual void OnMessagesDeleted(const std::string& app_id) OVERRIDE; | 41 virtual void OnMessagesDeleted(const std::string& app_id) OVERRIDE; |
| 42 virtual void OnSendError( | 42 virtual void OnSendError( |
| 43 const std::string& app_id, | 43 const std::string& app_id, |
| 44 const GCMClient::SendErrorDetails& send_error_details) OVERRIDE; | 44 const GCMClient::SendErrorDetails& send_error_details) OVERRIDE; |
| 45 virtual bool CanHandle(const std::string& app_id) const OVERRIDE; | 45 virtual bool CanHandle(const std::string& app_id) const OVERRIDE; |
| 46 | 46 |
| 47 // content::PushMessagingService implementation: | 47 // content::PushMessagingService implementation: |
| 48 virtual void Register( | 48 virtual void Register( |
| 49 const std::string& app_id, | 49 const std::string& app_id, |
| 50 const std::string& sender_id, | 50 const std::string& sender_id, |
| 51 const int renderer_id, |
| 52 const int router_id, |
| 51 const content::PushMessagingService::RegisterCallback& callback) OVERRIDE; | 53 const content::PushMessagingService::RegisterCallback& callback) OVERRIDE; |
| 52 | 54 |
| 53 private: | 55 private: |
| 54 void DidRegister( | 56 void DidRegister( |
| 55 const std::string& app_id, | 57 const std::string& app_id, |
| 56 const content::PushMessagingService::RegisterCallback& callback, | 58 const content::PushMessagingService::RegisterCallback& callback, |
| 57 const std::string& registration_id, | 59 const std::string& registration_id, |
| 58 GCMClient::Result result); | 60 GCMClient::Result result); |
| 59 | 61 |
| 62 void DidRequestPermission( |
| 63 const std::string& sender_id, |
| 64 const std::string& app_id, |
| 65 const content::PushMessagingService::RegisterCallback& callback, |
| 66 bool allow); |
| 67 |
| 60 GCMProfileService* gcm_profile_service_; // It owns us. | 68 GCMProfileService* gcm_profile_service_; // It owns us. |
| 61 | 69 |
| 62 Profile* profile_; // It owns our owner. | 70 Profile* profile_; // It owns our owner. |
| 63 | 71 |
| 64 base::WeakPtrFactory<PushMessagingServiceImpl> weak_factory_; | 72 base::WeakPtrFactory<PushMessagingServiceImpl> weak_factory_; |
| 65 | 73 |
| 66 DISALLOW_COPY_AND_ASSIGN(PushMessagingServiceImpl); | 74 DISALLOW_COPY_AND_ASSIGN(PushMessagingServiceImpl); |
| 67 }; | 75 }; |
| 68 | 76 |
| 69 } // namespace gcm | 77 } // namespace gcm |
| 70 | 78 |
| 71 #endif // CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_SERVICE_IMPL_H_ | 79 #endif // CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_SERVICE_IMPL_H_ |
| OLD | NEW |