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

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

Issue 2421463002: FetchMore functionality backend (Closed)
Patch Set: Introduced callback, removed strategy. Created 4 years, 2 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 MarkBookmarksDismissed(bookmark_model_, url); 145 MarkBookmarksDismissed(bookmark_model_, url);
146 } 146 }
147 147
148 void BookmarkSuggestionsProvider::FetchSuggestionImage( 148 void BookmarkSuggestionsProvider::FetchSuggestionImage(
149 const ContentSuggestion::ID& suggestion_id, 149 const ContentSuggestion::ID& suggestion_id,
150 const ImageFetchedCallback& callback) { 150 const ImageFetchedCallback& callback) {
151 base::ThreadTaskRunnerHandle::Get()->PostTask( 151 base::ThreadTaskRunnerHandle::Get()->PostTask(
152 FROM_HERE, base::Bind(callback, gfx::Image())); 152 FROM_HERE, base::Bind(callback, gfx::Image()));
153 } 153 }
154 154
155 void BookmarkSuggestionsProvider::FetchMore(const Category& category,
156 FetchedMoreCallback callback) {
157 // Ignored.
Marc Treib 2016/10/20 16:51:39 Hm. In principle, the bookmarks provider (like mos
Marc Treib 2016/10/28 14:49:49 I discussed this with dgn and bauerb: We'll unify
158 }
159
155 void BookmarkSuggestionsProvider::ClearHistory( 160 void BookmarkSuggestionsProvider::ClearHistory(
156 base::Time begin, 161 base::Time begin,
157 base::Time end, 162 base::Time end,
158 const base::Callback<bool(const GURL& url)>& filter) { 163 const base::Callback<bool(const GURL& url)>& filter) {
159 // TODO(vitaliii): Do not remove all dates, but only the ones matched by the 164 // TODO(vitaliii): Do not remove all dates, but only the ones matched by the
160 // time range and the filter. 165 // time range and the filter.
161 RemoveAllLastVisitDates(bookmark_model_); 166 RemoveAllLastVisitDates(bookmark_model_);
162 ClearDismissedSuggestionsForDebugging(provided_category_); 167 ClearDismissedSuggestionsForDebugging(provided_category_);
163 FetchBookmarks(); 168 FetchBookmarks();
164 // Temporarily enter an "explicitly disabled" state, so that any open UIs 169 // Temporarily enter an "explicitly disabled" state, so that any open UIs
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 308
304 void BookmarkSuggestionsProvider::NotifyStatusChanged( 309 void BookmarkSuggestionsProvider::NotifyStatusChanged(
305 CategoryStatus new_status) { 310 CategoryStatus new_status) {
306 if (category_status_ == new_status) 311 if (category_status_ == new_status)
307 return; 312 return;
308 category_status_ = new_status; 313 category_status_ = new_status;
309 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); 314 observer()->OnCategoryStatusChanged(this, provided_category_, new_status);
310 } 315 }
311 316
312 } // namespace ntp_snippets 317 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698