| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_NTP_SNIPPETS_REMOTE_REQUEST_PARAMS_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_REMOTE_REQUEST_PARAMS_H_ |
| 6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_REQUEST_PARAMS_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_REQUEST_PARAMS_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/optional.h" | 13 #include "base/optional.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "components/ntp_snippets/category.h" | 15 #include "components/ntp_snippets/category.h" |
| 16 | 16 |
| 17 namespace ntp_snippets { | 17 namespace ntp_snippets { |
| 18 | 18 |
| 19 // Enumeration listing all possible variants of dealing with personalization. | |
| 20 enum class Personalization { kPersonal, kNonPersonal, kBoth }; | |
| 21 | |
| 22 // Contains all parameters for fetching remote suggestions. | 19 // Contains all parameters for fetching remote suggestions. |
| 23 struct RequestParams { | 20 struct RequestParams { |
| 24 RequestParams(); | 21 RequestParams(); |
| 25 RequestParams(const RequestParams&); | 22 RequestParams(const RequestParams&); |
| 26 ~RequestParams(); | 23 ~RequestParams(); |
| 27 | 24 |
| 28 // BCP 47 language code specifying the user's UI language. | 25 // BCP 47 language code specifying the user's UI language. |
| 29 std::string language_code; | 26 std::string language_code; |
| 30 | 27 |
| 31 // A set of suggestion IDs that should not be returned again. | 28 // A set of suggestion IDs that should not be returned again. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 48 base::Callback<void(std::unique_ptr<base::Value> result)>; | 45 base::Callback<void(std::unique_ptr<base::Value> result)>; |
| 49 using ErrorCallback = base::Callback<void(const std::string& error)>; | 46 using ErrorCallback = base::Callback<void(const std::string& error)>; |
| 50 using ParseJSONCallback = | 47 using ParseJSONCallback = |
| 51 base::Callback<void(const std::string& raw_json_string, | 48 base::Callback<void(const std::string& raw_json_string, |
| 52 const SuccessCallback& success_callback, | 49 const SuccessCallback& success_callback, |
| 53 const ErrorCallback& error_callback)>; | 50 const ErrorCallback& error_callback)>; |
| 54 | 51 |
| 55 } // namespace ntp_snippets | 52 } // namespace ntp_snippets |
| 56 | 53 |
| 57 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_REQUEST_PARAMS_H_ | 54 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_REQUEST_PARAMS_H_ |
| OLD | NEW |