| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVICE_WEBRTC_SEND_COMMAND_REQUEST_H_ | |
| 6 #define CHROME_BROWSER_DEVTOOLS_DEVICE_WEBRTC_SEND_COMMAND_REQUEST_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "chrome/browser/local_discovery/gcd_api_flow.h" | |
| 10 | |
| 11 class SendCommandRequest : public local_discovery::GCDApiFlowRequest { | |
| 12 public: | |
| 13 class Delegate { | |
| 14 public: | |
| 15 // It's safe to destroy SendCommandRequest in these methods. | |
| 16 virtual void OnCommandSucceeded(const base::DictionaryValue& value) = 0; | |
| 17 virtual void OnCommandFailed() = 0; | |
| 18 | |
| 19 protected: | |
| 20 ~Delegate() {} | |
| 21 }; | |
| 22 | |
| 23 SendCommandRequest(const base::DictionaryValue* request, Delegate* delegate); | |
| 24 | |
| 25 // Implementation of GCDApiFlowRequest. | |
| 26 net::URLFetcher::RequestType GetRequestType() override; | |
| 27 void GetUploadData(std::string* upload_type, | |
| 28 std::string* upload_data) override; | |
| 29 void OnGCDAPIFlowError(local_discovery::GCDApiFlow::Status status) override; | |
| 30 void OnGCDAPIFlowComplete(const base::DictionaryValue& value) override; | |
| 31 GURL GetURL() override; | |
| 32 | |
| 33 private: | |
| 34 std::string upload_data_; | |
| 35 Delegate* const delegate_; | |
| 36 | |
| 37 DISALLOW_COPY_AND_ASSIGN(SendCommandRequest); | |
| 38 }; | |
| 39 | |
| 40 #endif // CHROME_BROWSER_DEVTOOLS_DEVICE_WEBRTC_SEND_COMMAND_REQUEST_H_ | |
| OLD | NEW |