Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_NTP_SNIPPETS_BREAKING_NEWS_SUBSCRIPTION_MANAGER_H_ | |
| 6 #define COMPONENTS_NTP_SNIPPETS_BREAKING_NEWS_SUBSCRIPTION_MANAGER_H_ | |
| 7 | |
| 8 #include "components/ntp_snippets/breaking_news/subscription_json_request.h" | |
| 9 #include "net/url_request/url_request_context_getter.h" | |
| 10 #include "url/gurl.h" | |
| 11 | |
| 12 namespace ntp_snippets { | |
|
Bernhard Bauer
2017/06/05 10:19:40
Empty lines please :)
mamir
2017/06/05 13:06:26
Done.
| |
| 13 class SubscriptionManager { | |
| 14 public: | |
| 15 SubscriptionManager( | |
| 16 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter, | |
| 17 PrefService* pref_service); | |
| 18 | |
| 19 ~SubscriptionManager(); | |
| 20 | |
| 21 void Subscribe(const std::string& token); | |
| 22 void Unsubscribe(const std::string& token); | |
| 23 | |
| 24 private: | |
| 25 // Holds the URL request context. | |
| 26 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; | |
| 27 | |
| 28 std::unique_ptr<internal::SubscriptionJsonRequest> subscription_request_; | |
| 29 | |
| 30 // API endpoint for subscribing. | |
| 31 // TODO(mamir): retrieve the correct fetch point | |
| 32 // See: | |
| 33 // https://cs.chromium.org/chromium/src/components/ntp_snippets/remote/remote_ suggestions_fetcher.cc?type=cs&l=175 | |
|
Bernhard Bauer
2017/06/05 10:19:40
Maybe just use the path (//components/...) ? Someo
mamir
2017/06/05 13:06:26
Done.
BTW: this is comment for me, and this will b
| |
| 34 // GURL url("http://valid-url.test") | |
|
Bernhard Bauer
2017/06/05 10:19:40
Remove this?
mamir
2017/06/05 13:06:26
Done.
| |
| 35 const GURL subscribe_url_{"http://valid-url.test"}; | |
| 36 | |
| 37 std::string subscription_token_; | |
| 38 PrefService* pref_service_; | |
| 39 | |
| 40 void DidSubscribe(const ntp_snippets::Status& status); | |
| 41 }; | |
|
Bernhard Bauer
2017/06/05 10:19:40
DISALLOW_COPY_AND_ASSIGN
mamir
2017/06/05 13:06:26
Done.
| |
| 42 } | |
| 43 #endif // COMPONENTS_NTP_SNIPPETS_BREAKING_NEWS_SUBSCRIPTION_MANAGER_H_ | |
| OLD | NEW |