OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "components/ntp_snippets/remote/ntp_snippets_service.h" | 5 #include "components/ntp_snippets/remote/ntp_snippets_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 params.hosts = hosts; | 324 params.hosts = hosts; |
325 params.interactive_request = interactive_request; | 325 params.interactive_request = interactive_request; |
326 snippets_fetcher_->FetchSnippets( | 326 snippets_fetcher_->FetchSnippets( |
327 params, base::BindOnce(&NTPSnippetsService::OnFetchFinished, | 327 params, base::BindOnce(&NTPSnippetsService::OnFetchFinished, |
328 base::Unretained(this))); | 328 base::Unretained(this))); |
329 } | 329 } |
330 | 330 |
331 void NTPSnippetsService::Fetch( | 331 void NTPSnippetsService::Fetch( |
332 const Category& category, | 332 const Category& category, |
333 const std::set<std::string>& known_suggestion_ids, | 333 const std::set<std::string>& known_suggestion_ids, |
334 FetchingCallback callback) { | 334 const FetchingCallback& callback) { |
335 if (!ready()) { | 335 if (!ready()) { |
336 CallWithEmptyResults(callback); | 336 CallWithEmptyResults(callback); |
337 return; | 337 return; |
338 } | 338 } |
339 NTPSnippetsFetcher::Params params = | 339 NTPSnippetsFetcher::Params params = |
340 BuildFetchParams(/*exclude_archived_suggestions=*/false); | 340 BuildFetchParams(/*exclude_archived_suggestions=*/false); |
341 params.excluded_ids.insert(known_suggestion_ids.begin(), | 341 params.excluded_ids.insert(known_suggestion_ids.begin(), |
342 known_suggestion_ids.end()); | 342 known_suggestion_ids.end()); |
343 params.interactive_request = true; | 343 params.interactive_request = true; |
344 params.exclusive_category = category; | 344 params.exclusive_category = category; |
(...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1237 } | 1237 } |
1238 | 1238 |
1239 NTPSnippetsService::CategoryContent::CategoryContent() = default; | 1239 NTPSnippetsService::CategoryContent::CategoryContent() = default; |
1240 NTPSnippetsService::CategoryContent::CategoryContent(CategoryContent&&) = | 1240 NTPSnippetsService::CategoryContent::CategoryContent(CategoryContent&&) = |
1241 default; | 1241 default; |
1242 NTPSnippetsService::CategoryContent::~CategoryContent() = default; | 1242 NTPSnippetsService::CategoryContent::~CategoryContent() = default; |
1243 NTPSnippetsService::CategoryContent& NTPSnippetsService::CategoryContent:: | 1243 NTPSnippetsService::CategoryContent& NTPSnippetsService::CategoryContent:: |
1244 operator=(CategoryContent&&) = default; | 1244 operator=(CategoryContent&&) = default; |
1245 | 1245 |
1246 } // namespace ntp_snippets | 1246 } // namespace ntp_snippets |
OLD | NEW |