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

Side by Side Diff: components/ntp_snippets/reading_list/reading_list_suggestions_provider.h

Issue 2755113002: Create ReadingListSuggestionsProvider (Closed)
Patch Set: Fix strings 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_NTP_SNIPPETS_READING_LIST_READING_LIST_SUGGESTIONS_PROVIDER_H _
6 #define COMPONENTS_NTP_SNIPPETS_READING_LIST_READING_LIST_SUGGESTIONS_PROVIDER_H _
7
8 #include <set>
9 #include <string>
10
11 #include "components/ntp_snippets/callbacks.h"
12 #include "components/ntp_snippets/category.h"
13 #include "components/ntp_snippets/category_info.h"
14 #include "components/ntp_snippets/category_status.h"
15 #include "components/ntp_snippets/content_suggestion.h"
16 #include "components/ntp_snippets/content_suggestions_provider.h"
17 #include "components/reading_list/core/reading_list_model_observer.h"
18
19 class ReadingListModel;
20
21 namespace ntp_snippets {
22
23 // Provides content suggestions from the Reading List.
24 class ReadingListSuggestionsProvider : public ContentSuggestionsProvider,
25 public ReadingListModelObserver {
26 public:
27 ReadingListSuggestionsProvider(ContentSuggestionsProvider::Observer* observer,
28 ReadingListModel* reading_list_model);
29 ~ReadingListSuggestionsProvider() override;
30
31 // ContentSuggestionsProvider implementation.
32 CategoryStatus GetCategoryStatus(Category category) override;
33 CategoryInfo GetCategoryInfo(Category category) override;
34 void DismissSuggestion(const ContentSuggestion::ID& suggestion_id) override;
35 void FetchSuggestionImage(const ContentSuggestion::ID& suggestion_id,
36 const ImageFetchedCallback& callback) override;
37 void Fetch(const Category& category,
38 const std::set<std::string>& known_suggestion_ids,
39 const FetchDoneCallback& callback) override;
40 void ClearHistory(
41 base::Time begin,
42 base::Time end,
43 const base::Callback<bool(const GURL& url)>& filter) override;
44 void ClearCachedSuggestions(Category category) override;
45 void GetDismissedSuggestionsForDebugging(
46 Category category,
47 const DismissedSuggestionsCallback& callback) override;
48 void ClearDismissedSuggestionsForDebugging(Category category) override;
49
50 // ReadingListModelObserver implementation.
51 void ReadingListModelLoaded(const ReadingListModel* model) override;
52
53 private:
54 void FetchReadingListInternal();
55
56 CategoryStatus category_status_;
57 const Category provided_category_;
58
59 ReadingListModel* reading_list_model_;
60
61 DISALLOW_COPY_AND_ASSIGN(ReadingListSuggestionsProvider);
62 };
63
64 } // namespace ntp_snippets
65
66 #endif // COMPONENTS_NTP_SNIPPETS_READING_LIST_READING_LIST_SUGGESTIONS_PROVIDE R_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698