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

Side by Side Diff: components/ntp_snippets/breaking_news/subscription_request_params.h

Issue 2918513002: [NTP::Push] Add the classes for sending a breaking news subscription request (Closed)
Patch Set: Created 3 years, 6 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
(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_REQUEST_PARAMS_H_
6 #define COMPONENTS_NTP_SNIPPETS_BREAKING_NEWS_SUBSCRIPTION_REQUEST_PARAMS_H_
7
8 #include <memory>
9 #include <set>
10 #include <string>
11
12 #include "base/callback.h"
13 #include "base/optional.h"
14 #include "base/values.h"
15 #include "components/ntp_snippets/category.h"
16
17 namespace ntp_snippets {
18
19 // Contains all parameters for subscribing for breaking news push messages.
20 struct SubscriptionRequestParams {
21 SubscriptionRequestParams();
22 SubscriptionRequestParams(const SubscriptionRequestParams&);
23 ~SubscriptionRequestParams();
24
25 // GCM subscribtion token obtain from GCM driver (instanceID::getToken())
Bernhard Bauer 2017/05/31 13:12:45 "subscription", "obtained"
mamir 2017/05/31 14:25:03 Done.
26 std::string token;
27
28 // TODO(mamir): Additional fields to be added: country, language.
29 };
30
31 // Callbacks for JSON parsing to allow injecting platform-dependent code.
32 using SuccessCallback =
33 base::Callback<void(std::unique_ptr<base::Value> result)>;
34 using ErrorCallback = base::Callback<void(const std::string& error)>;
35 using ParseJSONCallback =
36 base::Callback<void(const std::string& raw_json_string,
37 const SuccessCallback& success_callback,
38 const ErrorCallback& error_callback)>;
39
40 } // namespace ntp_snippets
41
42 #endif // COMPONENTS_NTP_SNIPPETS_BREAKING_NEWS_SUBSCRIPTION_REQUEST_PARAMS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698