Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |