| 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_CLOUD_PRINT_BASE_API_FLOW_H_ | 5 #ifndef CHROME_BROWSER_LOCAL_DISCOVERY_CLOUD_PRINT_BASE_API_FLOW_H_ |
| 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_CLOUD_PRINT_BASE_API_FLOW_H_ | 6 #define CHROME_BROWSER_LOCAL_DISCOVERY_CLOUD_PRINT_BASE_API_FLOW_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "chrome/browser/local_discovery/privet_constants.h" | 10 #include "chrome/browser/local_discovery/privet_constants.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 virtual void OnCloudPrintAPIFlowError(CloudPrintBaseApiFlow* flow, | 37 virtual void OnCloudPrintAPIFlowError(CloudPrintBaseApiFlow* flow, |
| 38 Status status) = 0; | 38 Status status) = 0; |
| 39 virtual void OnCloudPrintAPIFlowComplete( | 39 virtual void OnCloudPrintAPIFlowComplete( |
| 40 CloudPrintBaseApiFlow* flow, | 40 CloudPrintBaseApiFlow* flow, |
| 41 const base::DictionaryValue* value) = 0; | 41 const base::DictionaryValue* value) = 0; |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 // Create an OAuth2-based confirmation. | 44 // Create an OAuth2-based confirmation. |
| 45 CloudPrintBaseApiFlow(net::URLRequestContextGetter* request_context, | 45 CloudPrintBaseApiFlow(net::URLRequestContextGetter* request_context, |
| 46 OAuth2TokenService* token_service_, | 46 OAuth2TokenService* token_service_, |
| 47 const std::string& account_id, |
| 47 const GURL& automated_claim_url, | 48 const GURL& automated_claim_url, |
| 48 Delegate* delegate); | 49 Delegate* delegate); |
| 49 | 50 |
| 50 // Create a cookie-based confirmation. | 51 // Create a cookie-based confirmation. |
| 51 CloudPrintBaseApiFlow(net::URLRequestContextGetter* request_context, | 52 CloudPrintBaseApiFlow(net::URLRequestContextGetter* request_context, |
| 52 int user_index, | 53 int user_index, |
| 53 const std::string& xsrf_token, | 54 const std::string& xsrf_token, |
| 54 const GURL& automated_claim_url, | 55 const GURL& automated_claim_url, |
| 55 Delegate* delegate); | 56 Delegate* delegate); |
| 56 | 57 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 82 | 83 |
| 83 private: | 84 private: |
| 84 bool UseOAuth2() { return user_index_ == kAccountIndexUseOAuth2; } | 85 bool UseOAuth2() { return user_index_ == kAccountIndexUseOAuth2; } |
| 85 | 86 |
| 86 void CreateRequest(const GURL& url); | 87 void CreateRequest(const GURL& url); |
| 87 | 88 |
| 88 scoped_ptr<net::URLFetcher> url_fetcher_; | 89 scoped_ptr<net::URLFetcher> url_fetcher_; |
| 89 scoped_ptr<OAuth2TokenService::Request> oauth_request_; | 90 scoped_ptr<OAuth2TokenService::Request> oauth_request_; |
| 90 scoped_refptr<net::URLRequestContextGetter> request_context_; | 91 scoped_refptr<net::URLRequestContextGetter> request_context_; |
| 91 OAuth2TokenService* token_service_; | 92 OAuth2TokenService* token_service_; |
| 93 std::string account_id_; |
| 92 int user_index_; | 94 int user_index_; |
| 93 std::string xsrf_token_; | 95 std::string xsrf_token_; |
| 94 GURL url_; | 96 GURL url_; |
| 95 Delegate* delegate_; | 97 Delegate* delegate_; |
| 96 }; | 98 }; |
| 97 | 99 |
| 98 } // namespace local_discovery | 100 } // namespace local_discovery |
| 99 | 101 |
| 100 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_CLOUD_PRINT_BASE_API_FLOW_H_ | 102 #endif // CHROME_BROWSER_LOCAL_DISCOVERY_CLOUD_PRINT_BASE_API_FLOW_H_ |
| OLD | NEW |