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

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

Issue 2232783002: Support action button to fetch more content suggestions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@snippetsbridge
Patch Set: Refactor NewTabPageAdapterTest Created 4 years, 4 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 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/ntp_snippets_service.h" 5 #include "components/ntp_snippets/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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 } 277 }
278 278
279 CategoryStatus NTPSnippetsService::GetCategoryStatus(Category category) { 279 CategoryStatus NTPSnippetsService::GetCategoryStatus(Category category) {
280 DCHECK(category.IsKnownCategory(KnownCategories::ARTICLES)); 280 DCHECK(category.IsKnownCategory(KnownCategories::ARTICLES));
281 return category_status_; 281 return category_status_;
282 } 282 }
283 283
284 CategoryInfo NTPSnippetsService::GetCategoryInfo(Category category) { 284 CategoryInfo NTPSnippetsService::GetCategoryInfo(Category category) {
285 return CategoryInfo( 285 return CategoryInfo(
286 l10n_util::GetStringUTF16(IDS_NTP_ARTICLE_SUGGESTIONS_SECTION_HEADER), 286 l10n_util::GetStringUTF16(IDS_NTP_ARTICLE_SUGGESTIONS_SECTION_HEADER),
287 ContentSuggestionsCardLayout::FULL_CARD); 287 ContentSuggestionsCardLayout::FULL_CARD, false);
Marc Treib 2016/08/12 08:44:39 Also here: comment to explain what the "false" mea
Philipp Keck 2016/08/12 09:11:32 Done.
288 } 288 }
289 289
290 void NTPSnippetsService::DismissSuggestion(const std::string& suggestion_id) { 290 void NTPSnippetsService::DismissSuggestion(const std::string& suggestion_id) {
291 if (!ready()) 291 if (!ready())
292 return; 292 return;
293 293
294 std::string snippet_id = GetWithinCategoryIDFromUniqueID(suggestion_id); 294 std::string snippet_id = GetWithinCategoryIDFromUniqueID(suggestion_id);
295 295
296 auto it = 296 auto it =
297 std::find_if(snippets_.begin(), snippets_.end(), 297 std::find_if(snippets_.begin(), snippets_.end(),
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 void NTPSnippetsService::UpdateCategoryStatus(CategoryStatus status) { 813 void NTPSnippetsService::UpdateCategoryStatus(CategoryStatus status) {
814 if (status == category_status_) 814 if (status == category_status_)
815 return; 815 return;
816 816
817 category_status_ = status; 817 category_status_ = status;
818 observer()->OnCategoryStatusChanged(this, provided_category_, 818 observer()->OnCategoryStatusChanged(this, provided_category_,
819 category_status_); 819 category_status_);
820 } 820 }
821 821
822 } // namespace ntp_snippets 822 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698