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

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

Issue 2149453004: Implement first version of OfflinePageSuggestionsProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move the factory to c/b/android/ntp and Marc's comments Created 4 years, 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_NTP_SNIPPETS_SERVICE_H_ 5 #ifndef COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_
6 #define COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ 6 #define COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 class NTPSnippetsDatabase; 61 class NTPSnippetsDatabase;
62 class NTPSnippetsServiceObserver; 62 class NTPSnippetsServiceObserver;
63 63
64 // Stores and vends fresh content data for the NTP. 64 // Stores and vends fresh content data for the NTP.
65 // TODO(pke): Rename this service to ArticleSuggestionsService and move to 65 // TODO(pke): Rename this service to ArticleSuggestionsService and move to
66 // a subdirectory. 66 // a subdirectory.
67 class NTPSnippetsService : public KeyedService, 67 class NTPSnippetsService : public KeyedService,
68 public image_fetcher::ImageFetcherDelegate, 68 public image_fetcher::ImageFetcherDelegate,
69 public ContentSuggestionsProvider { 69 public ContentSuggestionsProvider {
70 public: 70 public:
71 using ImageFetchedCallback =
72 base::Callback<void(const std::string& suggestion_id, const gfx::Image&)>;
73 71
Marc Treib 2016/07/14 14:17:24 nitty nit: also remove the empty line please :)
Philipp Keck 2016/07/14 15:30:06 Done.
74 // |application_language_code| should be a ISO 639-1 compliant string, e.g. 72 // |application_language_code| should be a ISO 639-1 compliant string, e.g.
75 // 'en' or 'en-US'. Note that this code should only specify the language, not 73 // 'en' or 'en-US'. Note that this code should only specify the language, not
76 // the locale, so 'en_US' (English language with US locale) and 'en-GB_US' 74 // the locale, so 'en_US' (English language with US locale) and 'en-GB_US'
77 // (British English person in the US) are not language codes. 75 // (British English person in the US) are not language codes.
78 NTPSnippetsService(bool enabled, 76 NTPSnippetsService(bool enabled,
79 PrefService* pref_service, 77 PrefService* pref_service,
80 suggestions::SuggestionsService* suggestions_service, 78 suggestions::SuggestionsService* suggestions_service,
81 const std::string& application_language_code, 79 const std::string& application_language_code,
82 NTPSnippetsScheduler* scheduler, 80 NTPSnippetsScheduler* scheduler,
83 std::unique_ptr<NTPSnippetsFetcher> snippets_fetcher, 81 std::unique_ptr<NTPSnippetsFetcher> snippets_fetcher,
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 // If the service might be enabled, DisabledReason::NONE will be provided. 337 // If the service might be enabled, DisabledReason::NONE will be provided.
340 virtual void NTPSnippetsServiceDisabledReasonChanged(DisabledReason) = 0; 338 virtual void NTPSnippetsServiceDisabledReasonChanged(DisabledReason) = 0;
341 339
342 protected: 340 protected:
343 virtual ~NTPSnippetsServiceObserver() {} 341 virtual ~NTPSnippetsServiceObserver() {}
344 }; 342 };
345 343
346 } // namespace ntp_snippets 344 } // namespace ntp_snippets
347 345
348 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ 346 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698