Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
|
sfiera
2017/06/02 08:43:05
2017
mamir
2017/06/02 13:13:57
Done.
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_NTP_SNIPPETS_REMOTE_CONTENT_SUGGESTIONS_GCM_APP_HANDLER_H_ | |
| 6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_CONTENT_SUGGESTIONS_GCM_APP_HANDLER_H_ | |
| 7 | |
| 8 #include "base/memory/weak_ptr.h" | |
| 9 #include "components/gcm_driver/gcm_app_handler.h" | |
| 10 #include "components/gcm_driver/instance_id/instance_id.h" | |
| 11 #include "components/ntp_snippets/breaking_news/breaking_news_subscription_manag er.h" | |
| 12 | |
| 13 namespace gcm { | |
| 14 class GCMDriver; | |
| 15 } | |
| 16 | |
| 17 namespace instance_id { | |
| 18 class InstanceIDDriver; | |
| 19 } | |
| 20 | |
| 21 namespace ntp_snippets { | |
| 22 | |
| 23 class ContentSuggestionsGCMAppHandler : public gcm::GCMAppHandler { | |
| 24 private: | |
|
sfiera
2017/06/02 08:43:05
Public declarations first
mamir
2017/06/02 13:13:57
Done.
| |
| 25 gcm::GCMDriver* gcm_driver_; | |
|
sfiera
2017/06/02 08:43:05
I'm all in favor of declaring "gcm::GCMDriver* con
mamir
2017/06/02 13:13:57
Done.
| |
| 26 std::unique_ptr<BreakingNewsSubscriptionManager> subscription_manager_; | |
| 27 | |
| 28 base::WeakPtrFactory<ContentSuggestionsGCMAppHandler> weak_factory_; | |
| 29 | |
| 30 public: | |
| 31 ContentSuggestionsGCMAppHandler( | |
| 32 gcm::GCMDriver* gcm_driver, | |
| 33 std::unique_ptr<BreakingNewsSubscriptionManager> subscriptionManager); | |
| 34 void DoSubscribe(instance_id::InstanceIDDriver* instance_id_driver); | |
|
sfiera
2017/06/02 08:43:05
Please add some comments to these methods.
Are Do
mamir
2017/06/02 13:13:57
PTAL
| |
| 35 void DidSubscribe(const std::string& subscription_id, | |
|
sfiera
2017/06/02 08:43:05
Private?
mamir
2017/06/02 13:13:57
Done.
| |
| 36 instance_id::InstanceID::Result result); | |
| 37 | |
| 38 void Shutdown(); | |
| 39 | |
| 40 // GCMAppHandler overrides. | |
|
sfiera
2017/06/02 08:43:05
Typically we place these sorts of overrides in the
mamir
2017/06/02 13:13:57
Done.
| |
| 41 void ShutdownHandler() override; | |
| 42 void OnStoreReset() override; | |
| 43 void OnMessage(const std::string& app_id, | |
| 44 const gcm::IncomingMessage& message) override; | |
| 45 void OnMessagesDeleted(const std::string& app_id) override; | |
| 46 void OnSendError(const std::string& app_id, | |
| 47 const gcm::GCMClient::SendErrorDetails& details) override; | |
| 48 void OnSendAcknowledged(const std::string& app_id, | |
| 49 const std::string& message_id) override; | |
| 50 }; | |
| 51 } // namespace ntp_snippets | |
| 52 | |
| 53 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_CONTENT_SUGGESTIONS_GCM_APP_HANDLER_H_ | |
| OLD | NEW |