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

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

Issue 2236303002: Make OfflinePage ContentSuggestions dismissable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: base::Value --> std::unique_ptr<base::Value> 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
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 protected: 116 protected:
117 ContentSuggestionsProvider(Observer* observer, 117 ContentSuggestionsProvider(Observer* observer,
118 CategoryFactory* category_factory); 118 CategoryFactory* category_factory);
119 119
120 // Creates a unique ID. The given |within_category_id| must be unique among 120 // Creates a unique ID. The given |within_category_id| must be unique among
121 // all suggestion IDs from this provider for the given |category|. This method 121 // all suggestion IDs from this provider for the given |category|. This method
122 // combines it with the |category| to form an ID that is unique 122 // combines it with the |category| to form an ID that is unique
123 // application-wide, because this provider is the only one that provides 123 // application-wide, because this provider is the only one that provides
124 // suggestions for that category. 124 // suggestions for that category.
125 std::string MakeUniqueID(Category category, 125 std::string MakeUniqueID(Category category,
126 const std::string& within_category_id); 126 const std::string& within_category_id) const;
127 127
128 // Reverse functions for MakeUniqueID() 128 // Reverse functions for MakeUniqueID()
129 Category GetCategoryFromUniqueID(const std::string& unique_id); 129 Category GetCategoryFromUniqueID(const std::string& unique_id) const;
130 std::string GetWithinCategoryIDFromUniqueID(const std::string& unique_id); 130 std::string GetWithinCategoryIDFromUniqueID(
131 const std::string& unique_id) const;
131 132
132 Observer* observer() const { return observer_; } 133 Observer* observer() const { return observer_; }
133 CategoryFactory* category_factory() const { return category_factory_; } 134 CategoryFactory* category_factory() const { return category_factory_; }
134 135
135 private: 136 private:
136 Observer* observer_; 137 Observer* observer_;
137 CategoryFactory* category_factory_; 138 CategoryFactory* category_factory_;
138 }; 139 };
139 140
140 } // namespace ntp_snippets 141 } // namespace ntp_snippets
141 142
142 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_ 143 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_
OLDNEW
« no previous file with comments | « chrome/browser/prefs/browser_prefs.cc ('k') | components/ntp_snippets/content_suggestions_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698