Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 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 CHROME_BROWSER_OFFLINE_PAGES_PREFETCH_PREFETCH_GCM_APP_HANDLER_H_ | |
| 6 #define CHROME_BROWSER_OFFLINE_PAGES_PREFETCH_PREFETCH_GCM_APP_HANDLER_H_ | |
| 7 | |
| 8 #include <vector> | |
|
fgorski
2017/05/16 20:03:01
#include <string> instead is more appropriate I th
dewittj
2017/05/16 22:58:22
Done.
| |
| 9 | |
| 10 #include "components/gcm_driver/common/gcm_messages.h" | |
| 11 #include "components/gcm_driver/gcm_app_handler.h" | |
| 12 #include "components/gcm_driver/gcm_driver.h" | |
| 13 #include "components/offline_pages/core/prefetch/prefetch_service.h" | |
| 14 #include "components/offline_pages/core/prefetch/prefetch_service_impl.h" | |
| 15 #include "url/gurl.h" | |
| 16 | |
| 17 namespace offline_pages { | |
| 18 | |
| 19 // Receives GCM messages and other channel status messages on behalf of the | |
| 20 // prefetch system. | |
| 21 class PrefetchGCMAppHandler : public gcm::GCMAppHandler, | |
| 22 public PrefetchServiceImpl::GCMAppHandler { | |
| 23 public: | |
| 24 PrefetchGCMAppHandler(); | |
| 25 ~PrefetchGCMAppHandler() override; | |
| 26 | |
| 27 // gcm::GCMAppHandler implementation. | |
| 28 void ShutdownHandler() override; | |
| 29 void OnStoreReset() override; | |
| 30 void OnMessage(const std::string& app_id, | |
| 31 const gcm::IncomingMessage& message) override; | |
| 32 void OnMessagesDeleted(const std::string& app_id) override; | |
| 33 void OnSendError( | |
| 34 const std::string& app_id, | |
| 35 const gcm::GCMClient::SendErrorDetails& send_error_details) override; | |
| 36 void OnSendAcknowledged(const std::string& app_id, | |
| 37 const std::string& message_id) override; | |
| 38 bool CanHandle(const std::string& app_id) const override; | |
| 39 | |
| 40 const std::string& app_id() const { return app_id_; } | |
| 41 | |
| 42 private: | |
| 43 std::string app_id_; | |
| 44 | |
| 45 DISALLOW_COPY_AND_ASSIGN(PrefetchGCMAppHandler); | |
| 46 }; | |
| 47 | |
| 48 } // namespace offline_pages | |
| 49 | |
| 50 #endif // CHROME_BROWSER_OFFLINE_PAGES_PREFETCH_PREFETCH_GCM_APP_HANDLER_H_ | |
| OLD | NEW |