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

Side by Side Diff: components/ntp_snippets/remote/json_request.cc

Issue 2663313002: 📰 Merge the has_fetch_more and has_reload actions (Closed)
Patch Set: rebase Created 3 years, 10 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
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/remote/json_request.h" 5 #include "components/ntp_snippets/remote/json_request.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 } // namespace 133 } // namespace
134 134
135 CategoryInfo BuildArticleCategoryInfo( 135 CategoryInfo BuildArticleCategoryInfo(
136 const base::Optional<base::string16>& title) { 136 const base::Optional<base::string16>& title) {
137 return CategoryInfo( 137 return CategoryInfo(
138 title.has_value() ? title.value() 138 title.has_value() ? title.value()
139 : l10n_util::GetStringUTF16( 139 : l10n_util::GetStringUTF16(
140 IDS_NTP_ARTICLE_SUGGESTIONS_SECTION_HEADER), 140 IDS_NTP_ARTICLE_SUGGESTIONS_SECTION_HEADER),
141 ContentSuggestionsCardLayout::FULL_CARD, 141 ContentSuggestionsCardLayout::FULL_CARD,
142 // TODO(dgn): merge has_more_action and has_reload_action when we remove 142 /*has_fetch_action=*/true,
143 // the kFetchMoreFeature flag. See https://crbug.com/667752
144 /*has_more_action=*/true,
145 /*has_reload_action=*/true,
146 /*has_view_all_action=*/false, 143 /*has_view_all_action=*/false,
147 /*show_if_empty=*/true, 144 /*show_if_empty=*/true,
148 l10n_util::GetStringUTF16(IDS_NTP_ARTICLE_SUGGESTIONS_SECTION_EMPTY)); 145 l10n_util::GetStringUTF16(IDS_NTP_ARTICLE_SUGGESTIONS_SECTION_EMPTY));
149 } 146 }
150 147
151 CategoryInfo BuildRemoteCategoryInfo(const base::string16& title, 148 CategoryInfo BuildRemoteCategoryInfo(const base::string16& title,
152 bool allow_fetching_more_results) { 149 bool allow_fetching_more_results) {
153 return CategoryInfo( 150 return CategoryInfo(
154 title, ContentSuggestionsCardLayout::FULL_CARD, 151 title, ContentSuggestionsCardLayout::FULL_CARD,
155 // TODO(dgn): merge has_more_action and has_reload_action when we remove 152 /*has_fetch_action=*/allow_fetching_more_results,
156 // the kFetchMoreFeature flag. See https://crbug.com/667752
157 /*has_more_action=*/allow_fetching_more_results,
158 /*has_reload_action=*/allow_fetching_more_results,
159 /*has_view_all_action=*/false, 153 /*has_view_all_action=*/false,
160 /*show_if_empty=*/false, 154 /*show_if_empty=*/false,
161 // TODO(tschumann): The message for no-articles is likely wrong 155 // TODO(tschumann): The message for no-articles is likely wrong
162 // and needs to be added to the stubby protocol if we want to 156 // and needs to be added to the stubby protocol if we want to
163 // support it. 157 // support it.
164 l10n_util::GetStringUTF16(IDS_NTP_ARTICLE_SUGGESTIONS_SECTION_EMPTY)); 158 l10n_util::GetStringUTF16(IDS_NTP_ARTICLE_SUGGESTIONS_SECTION_EMPTY));
165 } 159 }
166 160
167 JsonRequest::JsonRequest( 161 JsonRequest::JsonRequest(
168 base::Optional<Category> exclusive_category, 162 base::Optional<Category> exclusive_category,
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 "NewTabPage.Languages.UILanguageRatioInTwoTopLanguages", 496 "NewTabPage.Languages.UILanguageRatioInTwoTopLanguages",
503 ratio_ui_in_both_languages * 100); 497 ratio_ui_in_both_languages * 100);
504 break; 498 break;
505 } 499 }
506 } 500 }
507 } 501 }
508 502
509 } // namespace internal 503 } // namespace internal
510 504
511 } // namespace ntp_snippets 505 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698