Add GCMChannelStatusSyncer to schedule requests and enable/disable GCM
[chromium-blink-merge.git] / chrome / browser / local_discovery / gcd_registration_ticket_request.h
blobeb313de8bc40d2cbf178316230998728a21cd3de
1 // Copyright 2014 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.
5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_GCD_REGISTRATION_TICKET_REQUEST_H_
6 #define CHROME_BROWSER_LOCAL_DISCOVERY_GCD_REGISTRATION_TICKET_REQUEST_H_
8 #include <string>
10 #include "base/callback.h"
11 #include "base/values.h"
12 #include "chrome/browser/local_discovery/gcd_api_flow.h"
14 namespace local_discovery {
16 class GCDRegistrationTicketRequest : public GCDApiFlowRequest {
17 public:
18 // |ticket_id| contains the registration ticket ID, or an empty string in case
19 // of an error.
20 typedef base::Callback<void(const std::string& ticket_id,
21 const std::string& device_id)> ResponseCallback;
23 explicit GCDRegistrationTicketRequest(const ResponseCallback& callback);
24 virtual ~GCDRegistrationTicketRequest();
26 // GCDApiFlowImpl::Request implementation.
27 virtual void GetUploadData(std::string* upload_type,
28 std::string* upload_data) OVERRIDE;
29 virtual net::URLFetcher::RequestType GetRequestType() OVERRIDE;
30 virtual void OnGCDAPIFlowError(GCDApiFlow::Status status) OVERRIDE;
31 virtual void OnGCDAPIFlowComplete(
32 const base::DictionaryValue& value) OVERRIDE;
33 virtual GURL GetURL() OVERRIDE;
35 private:
36 ResponseCallback callback_;
39 } // namespace local_discovery
41 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_GCD_REGISTRATION_TICKET_REQUEST_H_