OLD | NEW |
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 #ifndef COMPONENTS_NTP_SNIPPETS_SESSIONS_FOREIGN_SESSIONS_SUGGESTIONS_PROVIDER_H
_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_SESSIONS_FOREIGN_SESSIONS_SUGGESTIONS_PROVIDER_H
_ |
6 #define COMPONENTS_NTP_SNIPPETS_SESSIONS_FOREIGN_SESSIONS_SUGGESTIONS_PROVIDER_H
_ | 6 #define COMPONENTS_NTP_SNIPPETS_SESSIONS_FOREIGN_SESSIONS_SUGGESTIONS_PROVIDER_H
_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 private: | 50 private: |
51 friend class ForeignSessionsSuggestionsProviderTest; | 51 friend class ForeignSessionsSuggestionsProviderTest; |
52 struct SessionData; | 52 struct SessionData; |
53 | 53 |
54 // ContentSuggestionsProvider implementation. | 54 // ContentSuggestionsProvider implementation. |
55 CategoryStatus GetCategoryStatus(Category category) override; | 55 CategoryStatus GetCategoryStatus(Category category) override; |
56 CategoryInfo GetCategoryInfo(Category category) override; | 56 CategoryInfo GetCategoryInfo(Category category) override; |
57 void DismissSuggestion(const ContentSuggestion::ID& suggestion_id) override; | 57 void DismissSuggestion(const ContentSuggestion::ID& suggestion_id) override; |
58 void FetchSuggestionImage(const ContentSuggestion::ID& suggestion_id, | 58 void FetchSuggestionImage(const ContentSuggestion::ID& suggestion_id, |
59 const ImageFetchedCallback& callback) override; | 59 const ImageFetchedCallback& callback) override; |
60 void FetchMore(const Category& category, | 60 void Fetch(const Category& category, |
61 FetchedMoreCallback callback) override; | 61 std::set<std::string> known_suggestion_ids, |
| 62 FetchingCallback callback) override; |
62 void ClearHistory( | 63 void ClearHistory( |
63 base::Time begin, | 64 base::Time begin, |
64 base::Time end, | 65 base::Time end, |
65 const base::Callback<bool(const GURL& url)>& filter) override; | 66 const base::Callback<bool(const GURL& url)>& filter) override; |
66 void ClearCachedSuggestions(Category category) override; | 67 void ClearCachedSuggestions(Category category) override; |
67 void GetDismissedSuggestionsForDebugging( | 68 void GetDismissedSuggestionsForDebugging( |
68 Category category, | 69 Category category, |
69 const DismissedSuggestionsCallback& callback) override; | 70 const DismissedSuggestionsCallback& callback) override; |
70 void ClearDismissedSuggestionsForDebugging(Category category) override; | 71 void ClearDismissedSuggestionsForDebugging(Category category) override; |
71 | 72 |
72 void OnForeignTabChange(); | 73 void OnForeignTabChange(); |
73 std::vector<ContentSuggestion> BuildSuggestions(); | 74 std::vector<ContentSuggestion> BuildSuggestions(); |
74 std::vector<SessionData> GetSuggestionCandidates(); | 75 std::vector<SessionData> GetSuggestionCandidates(); |
75 ContentSuggestion BuildSuggestion(const SessionData& data); | 76 ContentSuggestion BuildSuggestion(const SessionData& data); |
76 | 77 |
77 CategoryStatus category_status_; | 78 CategoryStatus category_status_; |
78 const Category provided_category_; | 79 const Category provided_category_; |
79 std::unique_ptr<ForeignSessionsProvider> foreign_sessions_provider_; | 80 std::unique_ptr<ForeignSessionsProvider> foreign_sessions_provider_; |
80 PrefService* pref_service_; | 81 PrefService* pref_service_; |
81 | 82 |
82 DISALLOW_COPY_AND_ASSIGN(ForeignSessionsSuggestionsProvider); | 83 DISALLOW_COPY_AND_ASSIGN(ForeignSessionsSuggestionsProvider); |
83 }; | 84 }; |
84 | 85 |
85 } // namespace ntp_snippets | 86 } // namespace ntp_snippets |
86 | 87 |
87 #endif // COMPONENTS_NTP_SNIPPETS_SESSIONS_FOREIGN_SESSIONS_SUGGESTIONS_PROVIDE
R_H_ | 88 #endif // COMPONENTS_NTP_SNIPPETS_SESSIONS_FOREIGN_SESSIONS_SUGGESTIONS_PROVIDE
R_H_ |
OLD | NEW |