| Index: components/ntp_snippets/breaking_news/subscription_request_params.h
|
| diff --git a/components/ntp_snippets/breaking_news/subscription_request_params.h b/components/ntp_snippets/breaking_news/subscription_request_params.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..fdaff9e5eee7a01a9a40365d6be5c831afc6edbe
|
| --- /dev/null
|
| +++ b/components/ntp_snippets/breaking_news/subscription_request_params.h
|
| @@ -0,0 +1,42 @@
|
| +// 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_NTP_SNIPPETS_BREAKING_NEWS_SUBSCRIPTION_REQUEST_PARAMS_H_
|
| +#define COMPONENTS_NTP_SNIPPETS_BREAKING_NEWS_SUBSCRIPTION_REQUEST_PARAMS_H_
|
| +
|
| +#include <memory>
|
| +#include <set>
|
| +#include <string>
|
| +
|
| +#include "base/callback.h"
|
| +#include "base/optional.h"
|
| +#include "base/values.h"
|
| +#include "components/ntp_snippets/category.h"
|
| +
|
| +namespace ntp_snippets {
|
| +
|
| +// Contains all parameters for subscribing for breaking news push messages.
|
| +struct SubscriptionRequestParams {
|
| + SubscriptionRequestParams();
|
| + SubscriptionRequestParams(const SubscriptionRequestParams&);
|
| + ~SubscriptionRequestParams();
|
| +
|
| + // GCM subscription token obtained from GCM driver (instanceID::getToken())
|
| + std::string token;
|
| +
|
| + // TODO(mamir): Additional fields to be added: country, language.
|
| +};
|
| +
|
| +// Callbacks for JSON parsing to allow injecting platform-dependent code.
|
| +using SuccessCallback =
|
| + base::Callback<void(std::unique_ptr<base::Value> result)>;
|
| +using ErrorCallback = base::Callback<void(const std::string& error)>;
|
| +using ParseJSONCallback =
|
| + base::Callback<void(const std::string& raw_json_string,
|
| + const SuccessCallback& success_callback,
|
| + const ErrorCallback& error_callback)>;
|
| +
|
| +} // namespace ntp_snippets
|
| +
|
| +#endif // COMPONENTS_NTP_SNIPPETS_BREAKING_NEWS_SUBSCRIPTION_REQUEST_PARAMS_H_
|
|
|