| 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/offline_pages/recent_tab_suggestions_provider.
h" | 5 #include "components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.
h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 void RecentTabSuggestionsProvider::FetchSuggestionImage( | 95 void RecentTabSuggestionsProvider::FetchSuggestionImage( |
| 96 const ContentSuggestion::ID& suggestion_id, | 96 const ContentSuggestion::ID& suggestion_id, |
| 97 const ImageFetchedCallback& callback) { | 97 const ImageFetchedCallback& callback) { |
| 98 // TODO(vitaliii): Fetch proper thumbnail from OfflinePageModel once it's | 98 // TODO(vitaliii): Fetch proper thumbnail from OfflinePageModel once it's |
| 99 // available there. | 99 // available there. |
| 100 base::ThreadTaskRunnerHandle::Get()->PostTask( | 100 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 101 FROM_HERE, base::Bind(callback, gfx::Image())); | 101 FROM_HERE, base::Bind(callback, gfx::Image())); |
| 102 } | 102 } |
| 103 | 103 |
| 104 void RecentTabSuggestionsProvider::Fetch( |
| 105 const Category& category, |
| 106 const std::set<std::string>& known_suggestion_ids, |
| 107 FetchingCallback callback) { |
| 108 NOTREACHED(); |
| 109 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 110 FROM_HERE, |
| 111 base::Bind(callback, base::Passed(std::vector<ContentSuggestion>()))); |
| 112 } |
| 113 |
| 104 void RecentTabSuggestionsProvider::ClearHistory( | 114 void RecentTabSuggestionsProvider::ClearHistory( |
| 105 base::Time begin, | 115 base::Time begin, |
| 106 base::Time end, | 116 base::Time end, |
| 107 const base::Callback<bool(const GURL& url)>& filter) { | 117 const base::Callback<bool(const GURL& url)>& filter) { |
| 108 ClearDismissedSuggestionsForDebugging(provided_category_); | 118 ClearDismissedSuggestionsForDebugging(provided_category_); |
| 109 FetchRecentTabs(); | 119 FetchRecentTabs(); |
| 110 } | 120 } |
| 111 | 121 |
| 112 void RecentTabSuggestionsProvider::ClearCachedSuggestions(Category category) { | 122 void RecentTabSuggestionsProvider::ClearCachedSuggestions(Category category) { |
| 113 // Ignored. | 123 // Ignored. |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 } | 272 } |
| 263 | 273 |
| 264 void RecentTabSuggestionsProvider::StoreDismissedIDsToPrefs( | 274 void RecentTabSuggestionsProvider::StoreDismissedIDsToPrefs( |
| 265 const std::set<std::string>& dismissed_ids) { | 275 const std::set<std::string>& dismissed_ids) { |
| 266 prefs::StoreDismissedIDsToPrefs(pref_service_, | 276 prefs::StoreDismissedIDsToPrefs(pref_service_, |
| 267 prefs::kDismissedRecentOfflineTabSuggestions, | 277 prefs::kDismissedRecentOfflineTabSuggestions, |
| 268 dismissed_ids); | 278 dismissed_ids); |
| 269 } | 279 } |
| 270 | 280 |
| 271 } // namespace ntp_snippets | 281 } // namespace ntp_snippets |
| OLD | NEW |