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 COMPONENTS_NTP_SNIPPETS_BREAKING_NEWS_SUBSCRIPTION_REQUEST_PARAMS_H_ | |
| 6 #define COMPONENTS_NTP_SNIPPETS_BREAKING_NEWS_SUBSCRIPTION_REQUEST_PARAMS_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 #include <set> | |
| 10 #include <string> | |
| 11 | |
| 12 #include "base/callback.h" | |
| 13 #include "base/optional.h" | |
| 14 #include "base/values.h" | |
| 15 #include "components/ntp_snippets/category.h" | |
| 16 | |
| 17 namespace ntp_snippets { | |
| 18 | |
| 19 // Contains all parameters for subscribing for breaking news push messages. | |
| 20 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.
| |
| 21 SubscriptionRequestParams(); | |
| 22 SubscriptionRequestParams(const SubscriptionRequestParams&); | |
| 23 ~SubscriptionRequestParams(); | |
| 24 | |
| 25 // GCM subscribtion token obtain from GCM driver (instanceID::getToken()) | |
| 26 std::string token; | |
| 27 | |
| 28 // 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.
| |
| 29 }; | |
| 30 | |
| 31 // 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.
| |
| 32 using SuccessCallback = | |
| 33 base::Callback<void(std::unique_ptr<base::Value> result)>; | |
| 34 using ErrorCallback = base::Callback<void(const std::string& error)>; | |
| 35 using ParseJSONCallback = | |
| 36 base::Callback<void(const std::string& raw_json_string, | |
| 37 const SuccessCallback& success_callback, | |
| 38 const ErrorCallback& error_callback)>; | |
| 39 | |
| 40 } // namespace ntp_snippets | |
| 41 | |
| 42 #endif // COMPONENTS_NTP_SNIPPETS_BREAKING_NEWS_SUBSCRIPTION_REQUEST_PARAMS_H_ | |
| OLD | NEW |