| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_CONFIRM_API_FLOW_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_CONFIRM_API_FLOW_H_ |
| 6 #define CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_CONFIRM_API_FLOW_H_ | 6 #define CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_CONFIRM_API_FLOW_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| 11 #include "chrome/browser/printing/cloud_print/gcd_api_flow.h" | 11 #include "chrome/browser/printing/cloud_print/gcd_api_flow.h" |
| 12 #include "net/url_request/url_request_context_getter.h" | |
| 13 | 12 |
| 14 namespace cloud_print { | 13 namespace cloud_print { |
| 15 | 14 |
| 16 // API call flow for server-side communication with CloudPrint for registration. | 15 // API call flow for server-side communication with CloudPrint for registration. |
| 17 class PrivetConfirmApiCallFlow : public CloudPrintApiFlowRequest { | 16 class PrivetConfirmApiCallFlow : public CloudPrintApiFlowRequest { |
| 18 public: | 17 public: |
| 19 typedef base::Callback<void(GCDApiFlow::Status /*success*/)> ResponseCallback; | 18 using ResponseCallback = base::Callback<void(GCDApiFlow::Status)>; |
| 20 | 19 |
| 21 // Create an OAuth2-based confirmation | 20 // Create an OAuth2-based confirmation |
| 22 PrivetConfirmApiCallFlow(const std::string& token, | 21 PrivetConfirmApiCallFlow(const std::string& token, |
| 23 const ResponseCallback& callback); | 22 const ResponseCallback& callback); |
| 24 | |
| 25 ~PrivetConfirmApiCallFlow() override; | 23 ~PrivetConfirmApiCallFlow() override; |
| 26 | 24 |
| 25 // CloudPrintApiFlowRequest implementation: |
| 27 void OnGCDApiFlowError(GCDApiFlow::Status status) override; | 26 void OnGCDApiFlowError(GCDApiFlow::Status status) override; |
| 28 void OnGCDApiFlowComplete(const base::DictionaryValue& value) override; | 27 void OnGCDApiFlowComplete(const base::DictionaryValue& value) override; |
| 29 net::URLFetcher::RequestType GetRequestType() override; | 28 net::URLFetcher::RequestType GetRequestType() override; |
| 30 | 29 |
| 31 GURL GetURL() override; | 30 GURL GetURL() override; |
| 32 | 31 |
| 33 private: | 32 private: |
| 34 ResponseCallback callback_; | 33 ResponseCallback callback_; |
| 35 std::string token_; | 34 const std::string token_; |
| 36 }; | 35 }; |
| 37 | 36 |
| 38 } // namespace cloud_print | 37 } // namespace cloud_print |
| 39 | 38 |
| 40 #endif // CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_CONFIRM_API_FLOW_H_ | 39 #endif // CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_CONFIRM_API_FLOW_H_ |
| OLD | NEW |