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

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: 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);
96 }
97
98 void BookmarkSuggestionsProvider::FetchMoreSuggestions(Category category) {
99 // Ignored.
Marc Treib 2016/08/10 09:40:31 NOTREACHED() since we don't expect this to get cal
Philipp Keck 2016/08/10 13:14:46 No. We will have global reload actions. Currently
Marc Treib 2016/08/10 13:19:04 But "refresh" is not quite the same as "fetch more
Philipp Keck 2016/08/10 15:16:41 True. I removed the whole FetchMoreSuggestions thi
96 } 100 }
97 101
98 void BookmarkSuggestionsProvider::DismissSuggestion( 102 void BookmarkSuggestionsProvider::DismissSuggestion(
99 const std::string& suggestion_id) { 103 const std::string& suggestion_id) {
100 DCHECK(bookmark_model_->loaded()); 104 DCHECK(bookmark_model_->loaded());
101 GURL url(GetWithinCategoryIDFromUniqueID(suggestion_id)); 105 GURL url(GetWithinCategoryIDFromUniqueID(suggestion_id));
102 MarkBookmarksDismissed(bookmark_model_, url); 106 MarkBookmarksDismissed(bookmark_model_, url);
103 } 107 }
104 108
105 void BookmarkSuggestionsProvider::FetchSuggestionImage( 109 void BookmarkSuggestionsProvider::FetchSuggestionImage(
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 214
211 void BookmarkSuggestionsProvider::NotifyStatusChanged( 215 void BookmarkSuggestionsProvider::NotifyStatusChanged(
212 CategoryStatus new_status) { 216 CategoryStatus new_status) {
213 if (category_status_ == new_status) 217 if (category_status_ == new_status)
214 return; 218 return;
215 category_status_ = new_status; 219 category_status_ = new_status;
216 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); 220 observer()->OnCategoryStatusChanged(this, provided_category_, new_status);
217 } 221 }
218 222
219 } // namespace ntp_snippets 223 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698