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

Unified Diff: components/ntp_snippets/reading_list/reading_list_suggestions_provider.h

Issue 2770893003: Add logic for fetching the Reading List entries (Closed)
Patch Set: Add title logic Created 3 years, 9 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
Index: components/ntp_snippets/reading_list/reading_list_suggestions_provider.h
diff --git a/components/ntp_snippets/reading_list/reading_list_suggestions_provider.h b/components/ntp_snippets/reading_list/reading_list_suggestions_provider.h
index 107d0b9ecf1140a11f3956d03063dec7eb0311b0..2463f4e0f72fe33dc09905f3351a5f50bd235768 100644
--- a/components/ntp_snippets/reading_list/reading_list_suggestions_provider.h
+++ b/components/ntp_snippets/reading_list/reading_list_suggestions_provider.h
@@ -8,6 +8,7 @@
#include <set>
#include <string>
+#include "base/scoped_observer.h"
#include "components/ntp_snippets/callbacks.h"
#include "components/ntp_snippets/category.h"
#include "components/ntp_snippets/category_info.h"
@@ -49,14 +50,20 @@ class ReadingListSuggestionsProvider : public ContentSuggestionsProvider,
// ReadingListModelObserver implementation.
void ReadingListModelLoaded(const ReadingListModel* model) override;
+ void ReadingListModelBeingDeleted(const ReadingListModel* model) override;
private:
+ // The actual method to fetch Reading List entries. Must be called after the
+ // model is loaded.
void FetchReadingListInternal();
+ // Updates the |category_status_| and notifies the |observer_|, if necessary.
+ void NotifyStatusChanged(CategoryStatus new_status);
CategoryStatus category_status_;
const Category provided_category_;
ReadingListModel* reading_list_model_;
+ ScopedObserver<ReadingListModel, ReadingListModelObserver> scoped_observer_;
DISALLOW_COPY_AND_ASSIGN(ReadingListSuggestionsProvider);
};
« no previous file with comments | « components/ntp_snippets/DEPS ('k') | components/ntp_snippets/reading_list/reading_list_suggestions_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698