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

Side by Side Diff: components/ntp_snippets/content_suggestions_provider.h

Issue 2207493002: Add CategoryInfo for meta information of content suggestions Categories (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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_CONTENT_SUGGESTIONS_PROVIDER_H_ 5 #ifndef COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_
6 #define COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_ 6 #define COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback_forward.h" 11 #include "base/callback_forward.h"
12 #include "base/strings/string16.h"
Marc Treib 2016/08/04 09:46:29 Not required here
Philipp Keck 2016/08/04 11:48:18 Done.
12 #include "components/ntp_snippets/category.h" 13 #include "components/ntp_snippets/category.h"
14 #include "components/ntp_snippets/category_info.h"
13 #include "components/ntp_snippets/category_status.h" 15 #include "components/ntp_snippets/category_status.h"
14 #include "components/ntp_snippets/content_suggestion.h" 16 #include "components/ntp_snippets/content_suggestion.h"
15 17
16 namespace gfx { 18 namespace gfx {
17 class Image; 19 class Image;
18 } 20 }
19 21
20 namespace ntp_snippets { 22 namespace ntp_snippets {
21 23
22 // Provides content suggestions from one particular source. 24 // Provides content suggestions from one particular source.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 // Returns the categories provided by this provider. 72 // Returns the categories provided by this provider.
71 // When the set of provided categories changes, the Observer is notified 73 // When the set of provided categories changes, the Observer is notified
72 // through |OnNewSuggestions| or |OnCategoryStatusChanged| for added 74 // through |OnNewSuggestions| or |OnCategoryStatusChanged| for added
73 // categories, and through |OnCategoryStatusChanged| with parameter 75 // categories, and through |OnCategoryStatusChanged| with parameter
74 // NOT_PROVIDED for removed categories. 76 // NOT_PROVIDED for removed categories.
75 virtual std::vector<Category> GetProvidedCategories() = 0; 77 virtual std::vector<Category> GetProvidedCategories() = 0;
76 78
77 // Determines the status of the given |category|, see CategoryStatus. 79 // Determines the status of the given |category|, see CategoryStatus.
78 virtual CategoryStatus GetCategoryStatus(Category category) = 0; 80 virtual CategoryStatus GetCategoryStatus(Category category) = 0;
79 81
82 // Returns the meta information for the given |category|.
83 virtual CategoryInfo GetCategoryInfo(Category category) = 0;
84
80 // Dismisses the suggestion with the given ID. A provider needs to ensure that 85 // Dismisses the suggestion with the given ID. A provider needs to ensure that
81 // a once-dismissed suggestion is never delivered again (through the 86 // a once-dismissed suggestion is never delivered again (through the
82 // Observer). The provider must not call Observer::OnSuggestionsChanged if the 87 // Observer). The provider must not call Observer::OnSuggestionsChanged if the
83 // removal of the dismissed suggestion is the only change. 88 // removal of the dismissed suggestion is the only change.
84 virtual void DismissSuggestion(const std::string& suggestion_id) = 0; 89 virtual void DismissSuggestion(const std::string& suggestion_id) = 0;
85 90
86 // Fetches the image for the suggestion with the given ID and returns it 91 // Fetches the image for the suggestion with the given ID and returns it
87 // through the callback. This fetch may occur locally or from the internet. 92 // through the callback. This fetch may occur locally or from the internet.
88 // If that suggestion doesn't exist, doesn't have an image or if the fetch 93 // If that suggestion doesn't exist, doesn't have an image or if the fetch
89 // fails, the callback gets a null image. 94 // fails, the callback gets a null image.
(...skipping 30 matching lines...) Expand all
120 CategoryFactory* category_factory() const { return category_factory_; } 125 CategoryFactory* category_factory() const { return category_factory_; }
121 126
122 private: 127 private:
123 Observer* observer_; 128 Observer* observer_;
124 CategoryFactory* category_factory_; 129 CategoryFactory* category_factory_;
125 }; 130 };
126 131
127 } // namespace ntp_snippets 132 } // namespace ntp_snippets
128 133
129 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_ 134 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698