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/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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 143 | 143 |
| 144 void OfflinePageSuggestionsProvider::FetchSuggestionImage( | 144 void OfflinePageSuggestionsProvider::FetchSuggestionImage( |
| 145 const std::string& suggestion_id, | 145 const std::string& suggestion_id, |
| 146 const ImageFetchedCallback& callback) { | 146 const ImageFetchedCallback& callback) { |
| 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::RemoveURLsFromHistory( | |
| 154 bool all_history, | |
| 155 const std::vector<GURL>& deleted_urls) { | |
| 156 // Ignored. | |
|
Marc Treib
2016/09/02 12:57:10
Even if all_history is true?
vitaliii
2016/09/02 14:13:17
Acknowledged.
| |
| 157 } | |
| 158 | |
| 153 void OfflinePageSuggestionsProvider::ClearHistory( | 159 void OfflinePageSuggestionsProvider::ClearHistory( |
| 154 base::Time begin, | 160 base::Time begin, |
| 155 base::Time end, | 161 base::Time end, |
| 156 const base::Callback<bool(const GURL& url)>& filter) { | 162 const base::Callback<bool(const GURL& url)>& filter) { |
| 157 ClearDismissedSuggestionsForDebugging(recent_tabs_category_); | 163 ClearDismissedSuggestionsForDebugging(recent_tabs_category_); |
| 158 ClearDismissedSuggestionsForDebugging(downloads_category_); | 164 ClearDismissedSuggestionsForDebugging(downloads_category_); |
| 159 FetchOfflinePages(); | 165 FetchOfflinePages(); |
| 160 } | 166 } |
| 161 | 167 |
| 162 void OfflinePageSuggestionsProvider::ClearCachedSuggestions(Category category) { | 168 void OfflinePageSuggestionsProvider::ClearCachedSuggestions(Category category) { |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 385 void OfflinePageSuggestionsProvider::StoreDismissedIDsToPrefs( | 391 void OfflinePageSuggestionsProvider::StoreDismissedIDsToPrefs( |
| 386 Category category, | 392 Category category, |
| 387 const std::set<std::string>& dismissed_ids) { | 393 const std::set<std::string>& dismissed_ids) { |
| 388 base::ListValue list; | 394 base::ListValue list; |
| 389 for (const std::string& dismissed_id : dismissed_ids) | 395 for (const std::string& dismissed_id : dismissed_ids) |
| 390 list.AppendString(dismissed_id); | 396 list.AppendString(dismissed_id); |
| 391 pref_service_->Set(GetDismissedPref(category), list); | 397 pref_service_->Set(GetDismissedPref(category), list); |
| 392 } | 398 } |
| 393 | 399 |
| 394 } // namespace ntp_snippets | 400 } // namespace ntp_snippets |
| OLD | NEW |