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

Side by Side Diff: components/ntp_snippets/bookmarks/bookmark_suggestions_provider.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 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/bookmarks/bookmark_suggestions_provider.h" 5 #include "components/ntp_snippets/bookmarks/bookmark_suggestions_provider.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 85
86 CategoryStatus BookmarkSuggestionsProvider::GetCategoryStatus( 86 CategoryStatus BookmarkSuggestionsProvider::GetCategoryStatus(
87 Category category) { 87 Category category) {
88 DCHECK_EQ(category, provided_category_); 88 DCHECK_EQ(category, provided_category_);
89 return category_status_; 89 return category_status_;
90 } 90 }
91 91
92 CategoryInfo BookmarkSuggestionsProvider::GetCategoryInfo(Category category) { 92 CategoryInfo BookmarkSuggestionsProvider::GetCategoryInfo(Category category) {
93 return CategoryInfo( 93 return CategoryInfo(
94 l10n_util::GetStringUTF16(IDS_NTP_BOOKMARK_SUGGESTIONS_SECTION_HEADER), 94 l10n_util::GetStringUTF16(IDS_NTP_BOOKMARK_SUGGESTIONS_SECTION_HEADER),
95 ContentSuggestionsCardLayout::MINIMAL_CARD); 95 ContentSuggestionsCardLayout::MINIMAL_CARD, true);
Marc Treib 2016/08/12 08:44:39 Optional: You could add a /* has_more_button */ co
Philipp Keck 2016/08/12 09:11:31 Done.
96 } 96 }
97 97
98 void BookmarkSuggestionsProvider::DismissSuggestion( 98 void BookmarkSuggestionsProvider::DismissSuggestion(
99 const std::string& suggestion_id) { 99 const std::string& suggestion_id) {
100 DCHECK(bookmark_model_->loaded()); 100 DCHECK(bookmark_model_->loaded());
101 GURL url(GetWithinCategoryIDFromUniqueID(suggestion_id)); 101 GURL url(GetWithinCategoryIDFromUniqueID(suggestion_id));
102 MarkBookmarksDismissed(bookmark_model_, url); 102 MarkBookmarksDismissed(bookmark_model_, url);
103 } 103 }
104 104
105 void BookmarkSuggestionsProvider::FetchSuggestionImage( 105 void BookmarkSuggestionsProvider::FetchSuggestionImage(
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 210
211 void BookmarkSuggestionsProvider::NotifyStatusChanged( 211 void BookmarkSuggestionsProvider::NotifyStatusChanged(
212 CategoryStatus new_status) { 212 CategoryStatus new_status) {
213 if (category_status_ == new_status) 213 if (category_status_ == new_status)
214 return; 214 return;
215 category_status_ = new_status; 215 category_status_ = new_status;
216 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); 216 observer()->OnCategoryStatusChanged(this, provided_category_, new_status);
217 } 217 }
218 218
219 } // namespace ntp_snippets 219 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698