| 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_LOCAL_DISCOVERY_PRIVET_CONFIRM_API_FLOW_H_ | 5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_CONFIRM_API_FLOW_H_ |
| 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_CONFIRM_API_FLOW_H_ | 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_CONFIRM_API_FLOW_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "chrome/browser/local_discovery/cloud_print_base_api_flow.h" | 10 #include "chrome/browser/local_discovery/cloud_print_base_api_flow.h" |
| 11 #include "net/url_request/url_request_context_getter.h" | 11 #include "net/url_request/url_request_context_getter.h" |
| 12 | 12 |
| 13 | 13 |
| 14 namespace local_discovery { | 14 namespace local_discovery { |
| 15 | 15 |
| 16 // API call flow for server-side communication with cloudprint for registration. | 16 // API call flow for server-side communication with cloudprint for registration. |
| 17 class PrivetConfirmApiCallFlow : public CloudPrintBaseApiFlow::Delegate { | 17 class PrivetConfirmApiCallFlow : public CloudPrintBaseApiFlow::Delegate { |
| 18 public: | 18 public: |
| 19 typedef base::Callback<void(CloudPrintBaseApiFlow::Status /*success*/)> | 19 typedef base::Callback<void(CloudPrintBaseApiFlow::Status /*success*/)> |
| 20 ResponseCallback; | 20 ResponseCallback; |
| 21 | 21 |
| 22 // Create an OAuth2-based confirmation | 22 // Create an OAuth2-based confirmation |
| 23 PrivetConfirmApiCallFlow(net::URLRequestContextGetter* request_context, | 23 PrivetConfirmApiCallFlow(net::URLRequestContextGetter* request_context, |
| 24 OAuth2TokenService* token_service_, | 24 OAuth2TokenService* token_service_, |
| 25 const std::string& account_id, |
| 25 const GURL& automated_claim_url, | 26 const GURL& automated_claim_url, |
| 26 const ResponseCallback& callback); | 27 const ResponseCallback& callback); |
| 27 | 28 |
| 28 // Create a cookie-based confirmation | 29 // Create a cookie-based confirmation |
| 29 PrivetConfirmApiCallFlow(net::URLRequestContextGetter* request_context, | 30 PrivetConfirmApiCallFlow(net::URLRequestContextGetter* request_context, |
| 30 int user_index, | 31 int user_index, |
| 31 const std::string& xsrf_token, | 32 const std::string& xsrf_token, |
| 32 const GURL& automated_claim_url, | 33 const GURL& automated_claim_url, |
| 33 const ResponseCallback& callback); | 34 const ResponseCallback& callback); |
| 34 | 35 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 48 } | 49 } |
| 49 | 50 |
| 50 private: | 51 private: |
| 51 CloudPrintBaseApiFlow flow_; | 52 CloudPrintBaseApiFlow flow_; |
| 52 ResponseCallback callback_; | 53 ResponseCallback callback_; |
| 53 }; | 54 }; |
| 54 | 55 |
| 55 } // namespace local_discovery | 56 } // namespace local_discovery |
| 56 | 57 |
| 57 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_CONFIRM_API_FLOW_H_ | 58 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_PRIVET_CONFIRM_API_FLOW_H_ |
| OLD | NEW |