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

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

Issue 2473483006: Adds a Fetch() method to the ContentSuggestionService which asks any provider to provide more conte… (Closed)
Patch Set: comments by Markus. 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::Fetch(
157 const Category& category,
158 const std::set<std::string>& known_suggestion_ids,
159 FetchingCallback callback) {
160 NOTREACHED();
161 base::ThreadTaskRunnerHandle::Get()->PostTask(
162 FROM_HERE,
163 base::Bind(callback, base::Passed(std::vector<ContentSuggestion>())));
164 }
165
156 void BookmarkSuggestionsProvider::ClearHistory( 166 void BookmarkSuggestionsProvider::ClearHistory(
157 base::Time begin, 167 base::Time begin,
158 base::Time end, 168 base::Time end,
159 const base::Callback<bool(const GURL& url)>& filter) { 169 const base::Callback<bool(const GURL& url)>& filter) {
160 // TODO(vitaliii): Do not remove all dates, but only the ones matched by the 170 // TODO(vitaliii): Do not remove all dates, but only the ones matched by the
161 // time range and the filter. 171 // time range and the filter.
162 RemoveAllLastVisitDates(bookmark_model_); 172 RemoveAllLastVisitDates(bookmark_model_);
163 ClearDismissedSuggestionsForDebugging(provided_category_); 173 ClearDismissedSuggestionsForDebugging(provided_category_);
164 FetchBookmarks(); 174 FetchBookmarks();
165 // Temporarily enter an "explicitly disabled" state, so that any open UIs 175 // Temporarily enter an "explicitly disabled" state, so that any open UIs
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 314
305 void BookmarkSuggestionsProvider::NotifyStatusChanged( 315 void BookmarkSuggestionsProvider::NotifyStatusChanged(
306 CategoryStatus new_status) { 316 CategoryStatus new_status) {
307 if (category_status_ == new_status) 317 if (category_status_ == new_status)
308 return; 318 return;
309 category_status_ = new_status; 319 category_status_ = new_status;
310 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); 320 observer()->OnCategoryStatusChanged(this, provided_category_, new_status);
311 } 321 }
312 322
313 } // namespace ntp_snippets 323 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698