| 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 { |
| 21 SubscriptionRequestParams(); |
| 22 SubscriptionRequestParams(const SubscriptionRequestParams&); |
| 23 ~SubscriptionRequestParams(); |
| 24 |
| 25 // GCM subscription token obtained from GCM driver (instanceID::getToken()) |
| 26 std::string token; |
| 27 |
| 28 // TODO(mamir): Additional fields to be added: country, language. |
| 29 }; |
| 30 |
| 31 // Callbacks for JSON parsing to allow injecting platform-dependent code. |
| 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 |