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

Side by Side Diff: components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc

Issue 2466863003: Finalize backend for fetching more NTPSnippets. (Closed)
Patch Set: Known suggestion are now a parameter for Fetch. Created 4 years, 1 month 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 MarkBookmarksDismissed(bookmark_model_, url); 146 MarkBookmarksDismissed(bookmark_model_, url);
147 } 147 }
148 148
149 void BookmarkSuggestionsProvider::FetchSuggestionImage( 149 void BookmarkSuggestionsProvider::FetchSuggestionImage(
150 const ContentSuggestion::ID& suggestion_id, 150 const ContentSuggestion::ID& suggestion_id,
151 const ImageFetchedCallback& callback) { 151 const ImageFetchedCallback& callback) {
152 base::ThreadTaskRunnerHandle::Get()->PostTask( 152 base::ThreadTaskRunnerHandle::Get()->PostTask(
153 FROM_HERE, base::Bind(callback, gfx::Image())); 153 FROM_HERE, base::Bind(callback, gfx::Image()));
154 } 154 }
155 155
156 void BookmarkSuggestionsProvider::FetchMore(const Category& category, 156 void BookmarkSuggestionsProvider::Fetch(
157 FetchedMoreCallback callback) { 157 const Category& category,
158 // Ignored. 158 std::set<std::string> known_suggestion_ids,
159 FetchingCallback callback) {
160 NOTREACHED();
159 } 161 }
160 162
161 void BookmarkSuggestionsProvider::ClearHistory( 163 void BookmarkSuggestionsProvider::ClearHistory(
162 base::Time begin, 164 base::Time begin,
163 base::Time end, 165 base::Time end,
164 const base::Callback<bool(const GURL& url)>& filter) { 166 const base::Callback<bool(const GURL& url)>& filter) {
165 // TODO(vitaliii): Do not remove all dates, but only the ones matched by the 167 // TODO(vitaliii): Do not remove all dates, but only the ones matched by the
166 // time range and the filter. 168 // time range and the filter.
167 RemoveAllLastVisitDates(bookmark_model_); 169 RemoveAllLastVisitDates(bookmark_model_);
168 ClearDismissedSuggestionsForDebugging(provided_category_); 170 ClearDismissedSuggestionsForDebugging(provided_category_);
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 311
310 void BookmarkSuggestionsProvider::NotifyStatusChanged( 312 void BookmarkSuggestionsProvider::NotifyStatusChanged(
311 CategoryStatus new_status) { 313 CategoryStatus new_status) {
312 if (category_status_ == new_status) 314 if (category_status_ == new_status)
313 return; 315 return;
314 category_status_ = new_status; 316 category_status_ = new_status;
315 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); 317 observer()->OnCategoryStatusChanged(this, provided_category_, new_status);
316 } 318 }
317 319
318 } // namespace ntp_snippets 320 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698