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

Unified Diff: chrome/browser/ntp_snippets/download_suggestions_provider.cc

Issue 2564163002: [Offline Pages] Remove load state from public OfflinePageModel API. (Closed)
Patch Set: Fix broken tests. Created 4 years 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
Index: chrome/browser/ntp_snippets/download_suggestions_provider.cc
diff --git a/chrome/browser/ntp_snippets/download_suggestions_provider.cc b/chrome/browser/ntp_snippets/download_suggestions_provider.cc
index 1189dd79942bbbc9192d5a45bfca4d5275f14de7..be7bd4dad8765a44c4e4f2833d7021de55de52dd 100644
--- a/chrome/browser/ntp_snippets/download_suggestions_provider.cc
+++ b/chrome/browser/ntp_snippets/download_suggestions_provider.cc
@@ -300,12 +300,6 @@ void DownloadSuggestionsProvider::
callback.Run(std::move(suggestions));
}
-void DownloadSuggestionsProvider::OfflinePageModelLoaded(
- offline_pages::OfflinePageModel* model) {
- DCHECK_EQ(offline_page_model_, model);
- AsynchronouslyFetchOfflinePagesDownloads(/*notify=*/true);
Marc Treib 2016/12/13 10:11:02 I guess we don't need this call, because we'll get
vitaliii 2016/12/15 10:20:37 I believe that even if we get OfflinePageAdded, we
-}
-
void DownloadSuggestionsProvider::OfflinePageAdded(
offline_pages::OfflinePageModel* model,
const offline_pages::OfflinePageItem& added_page) {
@@ -400,15 +394,6 @@ void DownloadSuggestionsProvider::AsynchronouslyFetchOfflinePagesDownloads(
return;
}
- if (!offline_page_model_->is_loaded()) {
- // Offline pages model is not ready yet and may return no offline pages.
- if (notify) {
- SubmitContentSuggestions();
- }
-
- return;
- }
-
offline_page_model_->GetPagesMatchingQuery(
BuildOfflinePageDownloadsQuery(offline_page_model_),
base::Bind(&DownloadSuggestionsProvider::UpdateOfflinePagesCache,
@@ -631,8 +616,6 @@ void DownloadSuggestionsProvider::UpdateOfflinePagesCache(
bool notify,
const std::vector<offline_pages::OfflinePageItem>&
all_download_offline_pages) {
- DCHECK(!offline_page_model_ || offline_page_model_->is_loaded());
-
std::set<std::string> old_dismissed_ids =
ReadOfflinePageDismissedIDsFromPrefs();
std::set<std::string> retained_dismissed_ids;

Powered by Google App Engine
This is Rietveld 408576698