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 ~GCDRegistrationTicketRequest() override
;
26 // GCDApiFlowImpl::Request implementation.
27 void GetUploadData(std::string
* upload_type
,
28 std::string
* upload_data
) override
;
29 net::URLFetcher::RequestType
GetRequestType() override
;
30 void OnGCDAPIFlowError(GCDApiFlow::Status status
) override
;
31 void OnGCDAPIFlowComplete(const base::DictionaryValue
& value
) override
;
32 GURL
GetURL() override
;
35 ResponseCallback callback_
;
38 } // namespace local_discovery
40 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_GCD_REGISTRATION_TICKET_REQUEST_H_