| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 void SetProfileForTesting(Profile* profile); | 75 void SetProfileForTesting(Profile* profile); |
| 76 | 76 |
| 77 private: | 77 private: |
| 78 void IncreasePushRegistrationCount(int add); | 78 void IncreasePushRegistrationCount(int add); |
| 79 void DecreasePushRegistrationCount(int subtract); | 79 void DecreasePushRegistrationCount(int subtract); |
| 80 | 80 |
| 81 void DeliverMessageCallback(const PushMessagingApplicationId& application_id, | 81 void DeliverMessageCallback(const PushMessagingApplicationId& application_id, |
| 82 const GCMClient::IncomingMessage& message, | 82 const GCMClient::IncomingMessage& message, |
| 83 content::PushDeliveryStatus status); | 83 content::PushDeliveryStatus status); |
| 84 | 84 |
| 85 // Developers are required to display a Web Notification in response to an |
| 86 // incoming push message in order to clarify to the user that something has |
| 87 // happened in the background. When they forget to do so, display a default |
| 88 // notification on their behalf. |
| 89 void RequireUserVisibleUX(const PushMessagingApplicationId& application_id); |
| 90 |
| 85 void RegisterEnd( | 91 void RegisterEnd( |
| 86 const content::PushMessagingService::RegisterCallback& callback, | 92 const content::PushMessagingService::RegisterCallback& callback, |
| 87 const std::string& registration_id, | 93 const std::string& registration_id, |
| 88 content::PushRegistrationStatus status); | 94 content::PushRegistrationStatus status); |
| 89 | 95 |
| 90 void DidRegister( | 96 void DidRegister( |
| 91 const content::PushMessagingService::RegisterCallback& callback, | 97 const content::PushMessagingService::RegisterCallback& callback, |
| 92 const std::string& registration_id, | 98 const std::string& registration_id, |
| 93 GCMClient::Result result); | 99 GCMClient::Result result); |
| 94 | 100 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 118 int push_registration_count_; | 124 int push_registration_count_; |
| 119 | 125 |
| 120 base::WeakPtrFactory<PushMessagingServiceImpl> weak_factory_; | 126 base::WeakPtrFactory<PushMessagingServiceImpl> weak_factory_; |
| 121 | 127 |
| 122 DISALLOW_COPY_AND_ASSIGN(PushMessagingServiceImpl); | 128 DISALLOW_COPY_AND_ASSIGN(PushMessagingServiceImpl); |
| 123 }; | 129 }; |
| 124 | 130 |
| 125 } // namespace gcm | 131 } // namespace gcm |
| 126 | 132 |
| 127 #endif // CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_SERVICE_IMPL_H_ | 133 #endif // CHROME_BROWSER_SERVICES_GCM_PUSH_MESSAGING_SERVICE_IMPL_H_ |
| OLD | NEW |