| 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 MarkBookmarksDismissed(bookmark_model_, url); | 177 MarkBookmarksDismissed(bookmark_model_, url); |
| 178 } | 178 } |
| 179 | 179 |
| 180 void BookmarkSuggestionsProvider::FetchSuggestionImage( | 180 void BookmarkSuggestionsProvider::FetchSuggestionImage( |
| 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::RemoveURLsFromHistory( |
| 188 bool all_history, |
| 189 const std::vector<GURL>& deleted_urls) { |
| 190 // TODO(vitaliii): Do not remove all dates, but only the ones in |
| 191 // |deleted_urls|. |
| 192 RemoveAllLastVisitDates(bookmark_model_); |
| 193 FetchBookmarks(); |
| 194 } |
| 195 |
| 187 void BookmarkSuggestionsProvider::ClearHistory( | 196 void BookmarkSuggestionsProvider::ClearHistory( |
| 188 base::Time begin, | 197 base::Time begin, |
| 189 base::Time end, | 198 base::Time end, |
| 190 const base::Callback<bool(const GURL& url)>& filter) { | 199 const base::Callback<bool(const GURL& url)>& filter) { |
| 191 // TODO(vitaliii): Do not remove all dates, but only the ones matched by the | 200 // TODO(vitaliii): Do not remove all dates, but only the ones matched by the |
| 192 // time range and the filter. | 201 // time range and the filter. |
| 193 RemoveAllLastVisitDates(bookmark_model_); | 202 RemoveAllLastVisitDates(bookmark_model_); |
| 194 ClearDismissedSuggestionsForDebugging(provided_category_); | 203 ClearDismissedSuggestionsForDebugging(provided_category_); |
| 195 FetchBookmarks(); | 204 FetchBookmarks(); |
| 196 } | 205 } |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 | 323 |
| 315 void BookmarkSuggestionsProvider::NotifyStatusChanged( | 324 void BookmarkSuggestionsProvider::NotifyStatusChanged( |
| 316 CategoryStatus new_status) { | 325 CategoryStatus new_status) { |
| 317 if (category_status_ == new_status) | 326 if (category_status_ == new_status) |
| 318 return; | 327 return; |
| 319 category_status_ = new_status; | 328 category_status_ = new_status; |
| 320 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); | 329 observer()->OnCategoryStatusChanged(this, provided_category_, new_status); |
| 321 } | 330 } |
| 322 | 331 |
| 323 } // namespace ntp_snippets | 332 } // namespace ntp_snippets |
| OLD | NEW |