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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 181 const std::string& suggestion_id, | 181 const std::string& suggestion_id, |
| 182 const ImageFetchedCallback& callback) { | 182 const ImageFetchedCallback& callback) { |
| 183 base::ThreadTaskRunnerHandle::Get()->PostTask( | 183 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 184 FROM_HERE, base::Bind(callback, gfx::Image())); | 184 FROM_HERE, base::Bind(callback, gfx::Image())); |
| 185 } | 185 } |
| 186 | 186 |
| 187 void BookmarkSuggestionsProvider::ClearHistory( | 187 void BookmarkSuggestionsProvider::ClearHistory( |
| 188 base::Time begin, | 188 base::Time begin, |
| 189 base::Time end, | 189 base::Time end, |
| 190 const base::Callback<bool(const GURL& url)>& filter) { | 190 const base::Callback<bool(const GURL& url)>& filter) { |
| 191 // TODO(vitaliii): Implement. See crbug.com/641321. | 191 // TODO(vitaliii): Do not remove all dates, but only the ones matched by the |
| 192 // time range and the filter. | |
| 193 RemoveAllLastVisitDates(bookmark_model_); | |
| 194 FetchBookmarks(); | |
| 195 ClearDismissedSuggestionsForDebugging(provided_category_); | |
|
Marc Treib
2016/09/01 14:11:20
Should we clear the dismissed first, and then re-f
vitaliii
2016/09/01 14:45:15
Done.
| |
| 192 } | 196 } |
| 193 | 197 |
| 194 void BookmarkSuggestionsProvider::ClearCachedSuggestions(Category category) { | 198 void BookmarkSuggestionsProvider::ClearCachedSuggestions(Category category) { |
| 195 DCHECK_EQ(category, provided_category_); | 199 DCHECK_EQ(category, provided_category_); |
| 196 // Ignored. | 200 // Ignored. |
| 197 } | 201 } |
| 198 | 202 |
| 199 void BookmarkSuggestionsProvider::GetDismissedSuggestionsForDebugging( | 203 void BookmarkSuggestionsProvider::GetDismissedSuggestionsForDebugging( |
| 200 Category category, | 204 Category category, |
| 201 const DismissedSuggestionsCallback& callback) { | 205 const DismissedSuggestionsCallback& callback) { |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 310 | 314 |
| 311 void BookmarkSuggestionsProvider::NotifyStatusChanged( | 315 void BookmarkSuggestionsProvider::NotifyStatusChanged( |
| 312 CategoryStatus new_status) { | 316 CategoryStatus new_status) { |
| 313 if (category_status_ == new_status) | 317 if (category_status_ == new_status) |
| 314 return; | 318 return; |
| 315 category_status_ = new_status; | 319 category_status_ = new_status; |
| 316 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); | 320 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); |
| 317 } | 321 } |
| 318 | 322 |
| 319 } // namespace ntp_snippets | 323 } // namespace ntp_snippets |
| OLD | NEW |