Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(387)

Side by Side Diff: components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc

Issue 2284393002: Add ClearHistory() to ContentSuggestionsService and its providers (Closed)
Patch Set: msramek@'s comments and filter. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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::ClearHistory(
154 base::Time begin,
155 base::Time end,
156 base::Callback<bool(const GURL& url)> filter) {
157 // TODO(vitaliii): Implement. See crbug.com/641321.
158 }
159
153 void OfflinePageSuggestionsProvider::ClearCachedSuggestions(Category category) { 160 void OfflinePageSuggestionsProvider::ClearCachedSuggestions(Category category) {
154 // Ignored. 161 // Ignored.
155 } 162 }
156 163
157 void OfflinePageSuggestionsProvider::GetDismissedSuggestionsForDebugging( 164 void OfflinePageSuggestionsProvider::GetDismissedSuggestionsForDebugging(
158 Category category, 165 Category category,
159 const DismissedSuggestionsCallback& callback) { 166 const DismissedSuggestionsCallback& callback) {
160 offline_page_model_->GetAllPages( 167 offline_page_model_->GetAllPages(
161 base::Bind(&OfflinePageSuggestionsProvider:: 168 base::Bind(&OfflinePageSuggestionsProvider::
162 OnOfflinePagesLoadedForDismissedDebugging, 169 OnOfflinePagesLoadedForDismissedDebugging,
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 void OfflinePageSuggestionsProvider::StoreDismissedIDsToPrefs( 383 void OfflinePageSuggestionsProvider::StoreDismissedIDsToPrefs(
377 Category category, 384 Category category,
378 const std::set<std::string>& dismissed_ids) { 385 const std::set<std::string>& dismissed_ids) {
379 base::ListValue list; 386 base::ListValue list;
380 for (const std::string& dismissed_id : dismissed_ids) 387 for (const std::string& dismissed_id : dismissed_ids)
381 list.AppendString(dismissed_id); 388 list.AppendString(dismissed_id);
382 pref_service_->Set(GetDismissedPref(category), list); 389 pref_service_->Set(GetDismissedPref(category), list);
383 } 390 }
384 391
385 } // namespace ntp_snippets 392 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698