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/offline_page_suggestions_provide
r.h" | 5 #include "components/ntp_snippets/offline_pages/offline_page_suggestions_provide
r.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/guid.h" | 10 #include "base/guid.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 // TODO(pke): Fetch proper thumbnail from OfflinePageModel once it's available | 147 // TODO(pke): Fetch proper thumbnail from OfflinePageModel once it's available |
148 // there. | 148 // there. |
149 base::ThreadTaskRunnerHandle::Get()->PostTask( | 149 base::ThreadTaskRunnerHandle::Get()->PostTask( |
150 FROM_HERE, base::Bind(callback, gfx::Image())); | 150 FROM_HERE, base::Bind(callback, gfx::Image())); |
151 } | 151 } |
152 | 152 |
153 void OfflinePageSuggestionsProvider::ClearHistory( | 153 void OfflinePageSuggestionsProvider::ClearHistory( |
154 base::Time begin, | 154 base::Time begin, |
155 base::Time end, | 155 base::Time end, |
156 const base::Callback<bool(const GURL& url)>& filter) { | 156 const base::Callback<bool(const GURL& url)>& filter) { |
157 // TODO(vitaliii): Implement. See crbug.com/641321. | 157 ClearDismissedSuggestionsForDebugging(recent_tabs_category_); |
| 158 ClearDismissedSuggestionsForDebugging(downloads_category_); |
| 159 FetchOfflinePages(); |
158 } | 160 } |
159 | 161 |
160 void OfflinePageSuggestionsProvider::ClearCachedSuggestions(Category category) { | 162 void OfflinePageSuggestionsProvider::ClearCachedSuggestions(Category category) { |
161 // Ignored. | 163 // Ignored. |
162 } | 164 } |
163 | 165 |
164 void OfflinePageSuggestionsProvider::GetDismissedSuggestionsForDebugging( | 166 void OfflinePageSuggestionsProvider::GetDismissedSuggestionsForDebugging( |
165 Category category, | 167 Category category, |
166 const DismissedSuggestionsCallback& callback) { | 168 const DismissedSuggestionsCallback& callback) { |
167 offline_page_model_->GetAllPages( | 169 offline_page_model_->GetAllPages( |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 void OfflinePageSuggestionsProvider::StoreDismissedIDsToPrefs( | 385 void OfflinePageSuggestionsProvider::StoreDismissedIDsToPrefs( |
384 Category category, | 386 Category category, |
385 const std::set<std::string>& dismissed_ids) { | 387 const std::set<std::string>& dismissed_ids) { |
386 base::ListValue list; | 388 base::ListValue list; |
387 for (const std::string& dismissed_id : dismissed_ids) | 389 for (const std::string& dismissed_id : dismissed_ids) |
388 list.AppendString(dismissed_id); | 390 list.AppendString(dismissed_id); |
389 pref_service_->Set(GetDismissedPref(category), list); | 391 pref_service_->Set(GetDismissedPref(category), list); |
390 } | 392 } |
391 | 393 |
392 } // namespace ntp_snippets | 394 } // namespace ntp_snippets |
OLD | NEW |