| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 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_BREAKING_NEWS_SUBSCRIPTION_MANAGER_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_BREAKING_NEWS_SUBSCRIPTION_MANAGER_H_ |
| 6 #define COMPONENTS_NTP_SNIPPETS_BREAKING_NEWS_SUBSCRIPTION_MANAGER_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_BREAKING_NEWS_SUBSCRIPTION_MANAGER_H_ |
| 7 | 7 |
| 8 #include "components/ntp_snippets/breaking_news/subscription_json_request.h" | 8 #include "components/ntp_snippets/breaking_news/subscription_json_request.h" |
| 9 #include "components/prefs/pref_registry_simple.h" | 9 #include "components/prefs/pref_registry_simple.h" |
| 10 #include "components/version_info/version_info.h" |
| 10 #include "net/url_request/url_request_context_getter.h" | 11 #include "net/url_request/url_request_context_getter.h" |
| 11 #include "url/gurl.h" | 12 #include "url/gurl.h" |
| 12 | 13 |
| 13 class PrefRegistrySimple; | 14 class PrefRegistrySimple; |
| 14 | 15 |
| 15 namespace ntp_snippets { | 16 namespace ntp_snippets { |
| 16 | 17 |
| 18 // Returns the appropriate API endpoint for subscribing for push updates, in |
| 19 // consideration of the channel and variation parameters. |
| 20 GURL GetPushUpdatesSubscriptionEndpoint(version_info::Channel channel); |
| 21 |
| 22 // Returns the appropriate API endpoint for unsubscribing for push updates, in |
| 23 // consideration of the channel and variation parameters. |
| 24 GURL GetPushUpdatesUnsubscriptionEndpoint(version_info::Channel channel); |
| 25 |
| 17 class SubscriptionManager { | 26 class SubscriptionManager { |
| 18 public: | 27 public: |
| 19 SubscriptionManager( | 28 SubscriptionManager( |
| 20 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter, | 29 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter, |
| 21 PrefService* pref_service, | 30 PrefService* pref_service, |
| 22 const GURL& subscribe_url, | 31 const GURL& subscribe_url, |
| 23 const GURL& unsubscribe_url); | 32 const GURL& unsubscribe_url); |
| 24 | 33 |
| 25 ~SubscriptionManager(); | 34 ~SubscriptionManager(); |
| 26 | 35 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 45 const GURL subscribe_url_; | 54 const GURL subscribe_url_; |
| 46 const GURL unsubscribe_url_; | 55 const GURL unsubscribe_url_; |
| 47 | 56 |
| 48 void DidSubscribe(const ntp_snippets::Status& status); | 57 void DidSubscribe(const ntp_snippets::Status& status); |
| 49 void DidUnsubscribe(const ntp_snippets::Status& status); | 58 void DidUnsubscribe(const ntp_snippets::Status& status); |
| 50 | 59 |
| 51 DISALLOW_COPY_AND_ASSIGN(SubscriptionManager); | 60 DISALLOW_COPY_AND_ASSIGN(SubscriptionManager); |
| 52 }; | 61 }; |
| 53 } | 62 } |
| 54 #endif // COMPONENTS_NTP_SNIPPETS_BREAKING_NEWS_SUBSCRIPTION_MANAGER_H_ | 63 #endif // COMPONENTS_NTP_SNIPPETS_BREAKING_NEWS_SUBSCRIPTION_MANAGER_H_ |
| OLD | NEW |