Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Side by Side Diff: components/ntp_snippets/ntp_snippets_fetcher.cc

Issue 1868523002: [NTP Snippets] Fetcher: only download snippets that have a thumbnail (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: separate restricts Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "components/ntp_snippets/ntp_snippets_fetcher.h" 5 #include "components/ntp_snippets/ntp_snippets_fetcher.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 16 matching lines...) Expand all
27 const char kContentSnippetsServerFormat[] = 27 const char kContentSnippetsServerFormat[] =
28 "https://chromereader-pa.googleapis.com/v1/fetch?key=%s"; 28 "https://chromereader-pa.googleapis.com/v1/fetch?key=%s";
29 29
30 const char kRequestParameterFormat[] = 30 const char kRequestParameterFormat[] =
31 "{" 31 "{"
32 " \"response_detail_level\": \"STANDARD\"," 32 " \"response_detail_level\": \"STANDARD\","
33 " \"advanced_options\": {" 33 " \"advanced_options\": {"
34 " \"local_scoring_params\": {" 34 " \"local_scoring_params\": {"
35 " \"content_params\": {" 35 " \"content_params\": {"
36 " \"only_return_personalized_results\": false" 36 " \"only_return_personalized_results\": false"
37 " },"
38 " \"content_restricts\": {"
39 " \"type\": \"METADATA\","
40 " \"value\": \"TITLE\""
41 " },"
42 " \"content_restricts\": {"
43 " \"type\": \"METADATA\","
44 " \"value\": \"SNIPPET\""
45 " },"
46 " \"content_restricts\": {"
47 " \"type\": \"METADATA\","
48 " \"value\": \"THUMBNAIL\""
37 " }" 49 " }"
38 "%s" 50 "%s"
39 " }," 51 " },"
40 " \"global_scoring_params\": {" 52 " \"global_scoring_params\": {"
41 " \"num_to_return\": 10" 53 " \"num_to_return\": 10"
42 " }" 54 " }"
43 " }" 55 " }"
44 "}"; 56 "}";
45 57
46 const char kHostRestrictFormat[] = 58 const char kHostRestrictFormat[] =
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 } 126 }
115 127
116 std::string response; 128 std::string response;
117 bool stores_result_to_string = source->GetResponseAsString(&response); 129 bool stores_result_to_string = source->GetResponseAsString(&response);
118 DCHECK(stores_result_to_string); 130 DCHECK(stores_result_to_string);
119 131
120 callback_list_.Notify(response); 132 callback_list_.Notify(response);
121 } 133 }
122 134
123 } // namespace ntp_snippets 135 } // namespace ntp_snippets
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698