Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / local_discovery / gcd_registration_ticket_request.h
blobd109eb0f53df3d9d870a3a5608eb670a063ff55d
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 ~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;
34 private:
35 ResponseCallback callback_;
38 } // namespace local_discovery
40 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_GCD_REGISTRATION_TICKET_REQUEST_H_