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

Side by Side Diff: components/ntp_snippets/sessions/foreign_sessions_suggestions_provider.h

Issue 2377663002: [NTP Snippets] Introduce ContentSuggestion::ID (Closed)
Patch Set: rebase Created 4 years, 2 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
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 static void RegisterProfilePrefs(PrefRegistrySimple* registry); 48 static void RegisterProfilePrefs(PrefRegistrySimple* registry);
49 49
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 std::string& suggestion_id) override; 57 void DismissSuggestion(const ContentSuggestion::ID& suggestion_id) override;
58 void FetchSuggestionImage(const std::string& suggestion_id, 58 void FetchSuggestionImage(const ContentSuggestion::ID& suggestion_id,
59 const ImageFetchedCallback& callback) override; 59 const ImageFetchedCallback& callback) override;
60 void ClearHistory( 60 void ClearHistory(
61 base::Time begin, 61 base::Time begin,
62 base::Time end, 62 base::Time end,
63 const base::Callback<bool(const GURL& url)>& filter) override; 63 const base::Callback<bool(const GURL& url)>& filter) override;
64 void ClearCachedSuggestions(Category category) override; 64 void ClearCachedSuggestions(Category category) override;
65 void GetDismissedSuggestionsForDebugging( 65 void GetDismissedSuggestionsForDebugging(
66 Category category, 66 Category category,
67 const DismissedSuggestionsCallback& callback) override; 67 const DismissedSuggestionsCallback& callback) override;
68 void ClearDismissedSuggestionsForDebugging(Category category) override; 68 void ClearDismissedSuggestionsForDebugging(Category category) override;
69 69
70 void OnForeignTabChange(); 70 void OnForeignTabChange();
71 std::vector<ContentSuggestion> BuildSuggestions(); 71 std::vector<ContentSuggestion> BuildSuggestions();
72 std::vector<SessionData> GetSuggestionCandidates(); 72 std::vector<SessionData> GetSuggestionCandidates();
73 ContentSuggestion BuildSuggestion(const SessionData& data); 73 ContentSuggestion BuildSuggestion(const SessionData& data);
74 74
75 CategoryStatus category_status_; 75 CategoryStatus category_status_;
76 const Category provided_category_; 76 const Category provided_category_;
77 std::unique_ptr<ForeignSessionsProvider> foreign_sessions_provider_; 77 std::unique_ptr<ForeignSessionsProvider> foreign_sessions_provider_;
78 PrefService* pref_service_; 78 PrefService* pref_service_;
79 79
80 DISALLOW_COPY_AND_ASSIGN(ForeignSessionsSuggestionsProvider); 80 DISALLOW_COPY_AND_ASSIGN(ForeignSessionsSuggestionsProvider);
81 }; 81 };
82 82
83 } // namespace ntp_snippets 83 } // namespace ntp_snippets
84 84
85 #endif // COMPONENTS_NTP_SNIPPETS_SESSIONS_FOREIGN_SESSIONS_SUGGESTIONS_PROVIDE R_H_ 85 #endif // COMPONENTS_NTP_SNIPPETS_SESSIONS_FOREIGN_SESSIONS_SUGGESTIONS_PROVIDE R_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698