Chromium Code Reviews| 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..2a97c49b0ddb770cfba8207ee40da614a337e2cc |
| --- /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 { |
|
fhorschig
2017/05/31 14:51:14
that is a very, very, very simple class.
are you s
mamir
2017/05/31 18:46:04
Done.
|
| + SubscriptionRequestParams(); |
| + SubscriptionRequestParams(const SubscriptionRequestParams&); |
| + ~SubscriptionRequestParams(); |
| + |
| + // GCM subscribtion token obtain from GCM driver (instanceID::getToken()) |
| + std::string token; |
| + |
| + // TODO(mamir): Additional fields to be added: country, language. |
|
fhorschig
2017/05/31 14:51:14
All these fields look easy enough to add as a Set{
mamir
2017/05/31 18:46:04
Acknowledged.
|
| +}; |
| + |
| +// Callbacks for JSON parsing to allow injecting platform-dependent code. |
|
fhorschig
2017/05/31 14:51:14
None of which are actually used.
mamir
2017/05/31 18:46:04
Acknowledged.
|
| +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_ |