| 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_CONTENT_SUGGESTIONS_SERVICE_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_SERVICE_H_ |
| 6 #define COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_SERVICE_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_SERVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 174 |
| 175 CategoryFactory* category_factory() { return &category_factory_; } | 175 CategoryFactory* category_factory() { return &category_factory_; } |
| 176 | 176 |
| 177 // The reference to the NTPSnippetsService provider should only be set by the | 177 // The reference to the NTPSnippetsService provider should only be set by the |
| 178 // factory and only be used for scheduling, periodic fetching and debugging. | 178 // factory and only be used for scheduling, periodic fetching and debugging. |
| 179 NTPSnippetsService* ntp_snippets_service() { return ntp_snippets_service_; } | 179 NTPSnippetsService* ntp_snippets_service() { return ntp_snippets_service_; } |
| 180 void set_ntp_snippets_service(NTPSnippetsService* ntp_snippets_service) { | 180 void set_ntp_snippets_service(NTPSnippetsService* ntp_snippets_service) { |
| 181 ntp_snippets_service_ = ntp_snippets_service; | 181 ntp_snippets_service_ = ntp_snippets_service; |
| 182 } | 182 } |
| 183 | 183 |
| 184 UserClassifier* user_classifier() { return &user_classifier_;} | 184 UserClassifier* user_classifier() { return &user_classifier_; } |
| 185 | 185 |
| 186 private: | 186 private: |
| 187 friend class ContentSuggestionsServiceTest; | 187 friend class ContentSuggestionsServiceTest; |
| 188 | 188 |
| 189 // Implementation of ContentSuggestionsProvider::Observer. | 189 // Implementation of ContentSuggestionsProvider::Observer. |
| 190 void OnNewSuggestions(ContentSuggestionsProvider* provider, | 190 void OnNewSuggestions(ContentSuggestionsProvider* provider, |
| 191 Category category, | 191 Category category, |
| 192 std::vector<ContentSuggestion> suggestions) override; | 192 std::vector<ContentSuggestion> suggestions) override; |
| 193 void OnCategoryStatusChanged(ContentSuggestionsProvider* provider, | 193 void OnCategoryStatusChanged(ContentSuggestionsProvider* provider, |
| 194 Category category, | 194 Category category, |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 NTPSnippetsService* ntp_snippets_service_; | 264 NTPSnippetsService* ntp_snippets_service_; |
| 265 | 265 |
| 266 UserClassifier user_classifier_; | 266 UserClassifier user_classifier_; |
| 267 | 267 |
| 268 DISALLOW_COPY_AND_ASSIGN(ContentSuggestionsService); | 268 DISALLOW_COPY_AND_ASSIGN(ContentSuggestionsService); |
| 269 }; | 269 }; |
| 270 | 270 |
| 271 } // namespace ntp_snippets | 271 } // namespace ntp_snippets |
| 272 | 272 |
| 273 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_SERVICE_H_ | 273 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_SERVICE_H_ |
| OLD | NEW |