| Index: components/offline_pages/core/prefetch/prefetch_gcm_app_handler.h
|
| diff --git a/components/offline_pages/core/prefetch/prefetch_gcm_app_handler.h b/components/offline_pages/core/prefetch/prefetch_gcm_app_handler.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..582aa0f6cae1780a38ca907e479e6ab62e195a5a
|
| --- /dev/null
|
| +++ b/components/offline_pages/core/prefetch/prefetch_gcm_app_handler.h
|
| @@ -0,0 +1,50 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_GCM_APP_HANDLER_H_
|
| +#define COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_GCM_APP_HANDLER_H_
|
| +
|
| +#include <string>
|
| +
|
| +#include "components/gcm_driver/common/gcm_messages.h"
|
| +#include "components/gcm_driver/gcm_app_handler.h"
|
| +#include "components/gcm_driver/gcm_driver.h"
|
| +#include "components/offline_pages/core/prefetch/prefetch_service.h"
|
| +#include "components/offline_pages/core/prefetch/prefetch_service_impl.h"
|
| +#include "url/gurl.h"
|
| +
|
| +namespace offline_pages {
|
| +
|
| +// Receives GCM messages and other channel status messages on behalf of the
|
| +// prefetch system.
|
| +class PrefetchGCMAppHandler : public gcm::GCMAppHandler,
|
| + public PrefetchServiceImpl::GCMAppHandler {
|
| + public:
|
| + PrefetchGCMAppHandler();
|
| + ~PrefetchGCMAppHandler() override;
|
| +
|
| + // gcm::GCMAppHandler implementation.
|
| + void ShutdownHandler() override;
|
| + void OnStoreReset() override;
|
| + void OnMessage(const std::string& app_id,
|
| + const gcm::IncomingMessage& message) override;
|
| + void OnMessagesDeleted(const std::string& app_id) override;
|
| + void OnSendError(
|
| + const std::string& app_id,
|
| + const gcm::GCMClient::SendErrorDetails& send_error_details) override;
|
| + void OnSendAcknowledged(const std::string& app_id,
|
| + const std::string& message_id) override;
|
| + bool CanHandle(const std::string& app_id) const override;
|
| +
|
| + const std::string& app_id() const { return app_id_; }
|
| +
|
| + private:
|
| + std::string app_id_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(PrefetchGCMAppHandler);
|
| +};
|
| +
|
| +} // namespace offline_pages
|
| +
|
| +#endif // COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_GCM_APP_HANDLER_H_
|
|
|