| 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_NTP_SNIPPETS_FETCHER_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_FETCHER_H_ |
| 6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_FETCHER_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_FETCHER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 // Enumeration listing all possible variants of dealing with personalization. | 106 // Enumeration listing all possible variants of dealing with personalization. |
| 107 enum class Personalization { kPersonal, kNonPersonal, kBoth }; | 107 enum class Personalization { kPersonal, kNonPersonal, kBoth }; |
| 108 | 108 |
| 109 // Contains all the parameters for one fetch. | 109 // Contains all the parameters for one fetch. |
| 110 struct Params { | 110 struct Params { |
| 111 Params(); | 111 Params(); |
| 112 Params(const Params&); | 112 Params(const Params&); |
| 113 ~Params(); | 113 ~Params(); |
| 114 | 114 |
| 115 // If non-empty, restricts the result to the given set of hosts. | |
| 116 std::set<std::string> hosts; | |
| 117 | |
| 118 // BCP 47 language code specifying the user's UI language. | 115 // BCP 47 language code specifying the user's UI language. |
| 119 std::string language_code; | 116 std::string language_code; |
| 120 | 117 |
| 121 // A set of suggestion IDs that should not be returned again. | 118 // A set of suggestion IDs that should not be returned again. |
| 122 std::set<std::string> excluded_ids; | 119 std::set<std::string> excluded_ids; |
| 123 | 120 |
| 124 // Maximum number of snippets to fetch. | 121 // Maximum number of snippets to fetch. |
| 125 int count_to_fetch = 0; | 122 int count_to_fetch = 0; |
| 126 | 123 |
| 127 // Whether this is an interactive request, i.e. triggered by an explicit | 124 // Whether this is an interactive request, i.e. triggered by an explicit |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 std::string last_status_; | 357 std::string last_status_; |
| 361 std::string last_fetch_json_; | 358 std::string last_fetch_json_; |
| 362 | 359 |
| 363 base::WeakPtrFactory<NTPSnippetsFetcher> weak_ptr_factory_; | 360 base::WeakPtrFactory<NTPSnippetsFetcher> weak_ptr_factory_; |
| 364 | 361 |
| 365 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsFetcher); | 362 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsFetcher); |
| 366 }; | 363 }; |
| 367 } // namespace ntp_snippets | 364 } // namespace ntp_snippets |
| 368 | 365 |
| 369 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_FETCHER_H_ | 366 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_FETCHER_H_ |
| OLD | NEW |