summaryrefslogtreecommitdiffstats
path: root/google_apis/gcm/engine/gcm_registration_request_handler.h
blob: 934f92790f451a1cb052726278e64dd8055c8121 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef GOOGLE_APIS_GCM_ENGINE_GCM_REGISTRATION_REQUEST_HANDLER_H_
#define GOOGLE_APIS_GCM_ENGINE_GCM_REGISTRATION_REQUEST_HANDLER_H_

#include "google_apis/gcm/engine/registration_request.h"

namespace gcm {

// Used to obtain the registration ID for applications that want to use GCM.
class GCM_EXPORT GCMRegistrationRequestHandler :
    public RegistrationRequest::CustomRequestHandler {
 public:
  GCMRegistrationRequestHandler(const std::string& senders);
  ~GCMRegistrationRequestHandler() override;

  // RegistrationRequest::RequestHandler overrides:
  void BuildRequestBody(std::string* body) override;
  void ReportUMAs(RegistrationRequest::Status status,
                  int retry_count,
                  base::TimeDelta complete_time) override;

 private:
  std::string senders_;

  DISALLOW_COPY_AND_ASSIGN(GCMRegistrationRequestHandler);
};

}  // namespace gcm

#endif  // GOOGLE_APIS_GCM_ENGINE_GCM_REGISTRATION_REQUEST_HANDLER_H_