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

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: 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 20 matching lines...) Expand all
31 "https://chromereader-pa.googleapis.com/v1/fetch"; 31 "https://chromereader-pa.googleapis.com/v1/fetch";
32 const char kAuthorizationRequestHeaderFormat[] = "Bearer %s"; 32 const char kAuthorizationRequestHeaderFormat[] = "Bearer %s";
33 33
34 const char kRequestParameterFormat[] = 34 const char kRequestParameterFormat[] =
35 "{" 35 "{"
36 " \"response_detail_level\": \"STANDARD\"," 36 " \"response_detail_level\": \"STANDARD\","
37 " \"advanced_options\": {" 37 " \"advanced_options\": {"
38 " \"local_scoring_params\": {" 38 " \"local_scoring_params\": {"
39 " \"content_params\": {" 39 " \"content_params\": {"
40 " \"only_return_personalized_results\": false" 40 " \"only_return_personalized_results\": false"
41 " },"
42 " \"content_restricts\": {"
43 " \"type\": \"METADATA\","
44 " \"value\": \"ALL\""
May 2016/04/06 13:39:20 Does ALL mean title, snippet, thumbnail, URL? Or w
Marc Treib 2016/04/06 13:52:54 ALL means title, snippet, and thumbnail. (Presumab
May 2016/04/07 16:05:12 Yeah, I think so. It would insulate us better from
Marc Treib 2016/04/07 16:15:52 Done.
41 " }" 45 " }"
42 "%s" 46 "%s"
43 " }," 47 " },"
44 " \"global_scoring_params\": {" 48 " \"global_scoring_params\": {"
45 " \"num_to_return\": 10" 49 " \"num_to_return\": 10"
46 " }" 50 " }"
47 " }" 51 " }"
48 "}"; 52 "}";
49 53
50 const char kHostRestrictFormat[] = 54 const char kHostRestrictFormat[] =
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 } 169 }
166 170
167 std::string response; 171 std::string response;
168 bool stores_result_to_string = source->GetResponseAsString(&response); 172 bool stores_result_to_string = source->GetResponseAsString(&response);
169 DCHECK(stores_result_to_string); 173 DCHECK(stores_result_to_string);
170 174
171 callback_list_.Notify(response); 175 callback_list_.Notify(response);
172 } 176 }
173 177
174 } // namespace ntp_snippets 178 } // 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