Index: components/ntp_snippets/breaking_news/subscription_manager.cc |
diff --git a/components/ntp_snippets/breaking_news/subscription_manager.cc b/components/ntp_snippets/breaking_news/subscription_manager.cc |
index 8f7dbc9a5b3f6f399f4fa12af234b4ab7530c5f3..d3b9cd6ccb259bef68738022f2efa8f235880bec 100644 |
--- a/components/ntp_snippets/breaking_news/subscription_manager.cc |
+++ b/components/ntp_snippets/breaking_news/subscription_manager.cc |
@@ -5,6 +5,7 @@ |
#include "components/ntp_snippets/breaking_news/subscription_manager.h" |
#include "base/bind.h" |
#include "components/ntp_snippets/breaking_news/subscription_json_request.h" |
+#include "components/ntp_snippets/ntp_snippets_constants.h" |
#include "components/ntp_snippets/pref_names.h" |
#include "components/prefs/pref_service.h" |
@@ -62,4 +63,26 @@ void SubscriptionManager::RegisterProfilePrefs(PrefRegistrySimple* registry) { |
registry->RegisterStringPref(prefs::kContentSuggestionsSubscriptionDataToken, |
std::string()); |
} |
+ |
+GURL GetPushUpdatesSubscriptionEndpoint(version_info::Channel channel) { |
+ // TODO(mamir) do we need this? |
sfiera
2017/06/07 13:58:15
I like having a param :) When I'm working, I use a
mamir
2017/06/08 09:58:28
Done.
|
+ // std::string endpoint = variations::GetVariationParamValueByFeature( |
+ // ntp_snippets::kArticleSuggestionsFeature, kContentSuggestionsBackend); |
+ // if (!endpoint.empty()) { |
+ // return GURL{endpoint}; |
+ // } |
+ |
+ switch (channel) { |
+ case version_info::Channel::STABLE: |
+ case version_info::Channel::BETA: |
+ return GURL{kPushUpdatesSubscriptionServer}; |
+ |
+ case version_info::Channel::DEV: |
+ case version_info::Channel::CANARY: |
+ case version_info::Channel::UNKNOWN: |
+ return GURL{kPushUpdatesSubscriptionStagingServer}; |
+ } |
+ NOTREACHED(); |
+ return GURL{kPushUpdatesSubscriptionStagingServer}; |
+} |
} // namespace ntp_snippets |