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_
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
{
18 // |ticket_id| contains the registration ticket ID, or an empty string in case
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
;
36 ResponseCallback callback_
;
39 } // namespace local_discovery
41 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_GCD_REGISTRATION_TICKET_REQUEST_H_