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

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

Issue 2421463002: FetchMore functionality backend (Closed)
Patch Set: Strategy pattern to handle differences in fetching procedure. 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 MarkBookmarksDismissed(bookmark_model_, url); 160 MarkBookmarksDismissed(bookmark_model_, url);
161 } 161 }
162 162
163 void BookmarkSuggestionsProvider::FetchSuggestionImage( 163 void BookmarkSuggestionsProvider::FetchSuggestionImage(
164 const ContentSuggestion::ID& suggestion_id, 164 const ContentSuggestion::ID& suggestion_id,
165 const ImageFetchedCallback& callback) { 165 const ImageFetchedCallback& callback) {
166 base::ThreadTaskRunnerHandle::Get()->PostTask( 166 base::ThreadTaskRunnerHandle::Get()->PostTask(
167 FROM_HERE, base::Bind(callback, gfx::Image())); 167 FROM_HERE, base::Bind(callback, gfx::Image()));
168 } 168 }
169 169
170 void BookmarkSuggestionsProvider::FetchMore() {
171 // Ignored.
172 }
173
174
170 void BookmarkSuggestionsProvider::ClearHistory( 175 void BookmarkSuggestionsProvider::ClearHistory(
171 base::Time begin, 176 base::Time begin,
172 base::Time end, 177 base::Time end,
173 const base::Callback<bool(const GURL& url)>& filter) { 178 const base::Callback<bool(const GURL& url)>& filter) {
174 // TODO(vitaliii): Do not remove all dates, but only the ones matched by the 179 // TODO(vitaliii): Do not remove all dates, but only the ones matched by the
175 // time range and the filter. 180 // time range and the filter.
176 RemoveAllLastVisitDates(bookmark_model_); 181 RemoveAllLastVisitDates(bookmark_model_);
177 ClearDismissedSuggestionsForDebugging(provided_category_); 182 ClearDismissedSuggestionsForDebugging(provided_category_);
178 FetchBookmarks(); 183 FetchBookmarks();
179 // Temporarily enter an "explicitly disabled" state, so that any open UIs 184 // Temporarily enter an "explicitly disabled" state, so that any open UIs
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 323
319 void BookmarkSuggestionsProvider::NotifyStatusChanged( 324 void BookmarkSuggestionsProvider::NotifyStatusChanged(
320 CategoryStatus new_status) { 325 CategoryStatus new_status) {
321 if (category_status_ == new_status) 326 if (category_status_ == new_status)
322 return; 327 return;
323 category_status_ = new_status; 328 category_status_ = new_status;
324 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); 329 observer()->OnCategoryStatusChanged(this, provided_category_, new_status);
325 } 330 }
326 331
327 } // namespace ntp_snippets 332 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698