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

Unified Diff: components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc

Issue 2212313002: Call FetchImageCallback asynchronously when no thumbnail exists (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bookmarksprovider
Patch Set: Marc's comments Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/ntp_snippets/content_suggestions_service_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc
diff --git a/components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc b/components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc
index d2380c8677267a65e76a71518ba5cc167c0ac8ec..2d262ec711ebf1b1a5eb978889aac741b2856c93 100644
--- a/components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc
+++ b/components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc
@@ -5,8 +5,11 @@
#include "components/ntp_snippets/offline_pages/offline_page_suggestions_provider.h"
#include "base/bind.h"
+#include "base/location.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/threading/thread_task_runner_handle.h"
+#include "ui/gfx/image/image.h"
using offline_pages::MultipleOfflinePageItemResult;
using offline_pages::OfflinePageModel;
@@ -58,7 +61,10 @@ void OfflinePageSuggestionsProvider::DismissSuggestion(
void OfflinePageSuggestionsProvider::FetchSuggestionImage(
const std::string& suggestion_id,
const ImageFetchedCallback& callback) {
- // TODO(pke): Implement.
+ // TODO(pke): Fetch proper thumbnail from OfflinePageModel once it's available
+ // there.
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(callback, suggestion_id, gfx::Image()));
}
void OfflinePageSuggestionsProvider::ClearCachedSuggestionsForDebugging() {
« no previous file with comments | « components/ntp_snippets/content_suggestions_service_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698