OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 COMPONENTS_PROXIMITY_AUTH_CRYPTAUTH_API_CALL_FLOW_H | 5 #ifndef COMPONENTS_PROXIMITY_AUTH_CRYPTAUTH_API_CALL_FLOW_H |
6 #define COMPONENTS_PROXIMITY_AUTH_CRYPTAUTH_API_CALL_FLOW_H | 6 #define COMPONENTS_PROXIMITY_AUTH_CRYPTAUTH_API_CALL_FLOW_H |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 CryptAuthApiCallFlow(const GURL& request_url); | 25 CryptAuthApiCallFlow(const GURL& request_url); |
26 ~CryptAuthApiCallFlow() override; | 26 ~CryptAuthApiCallFlow() override; |
27 | 27 |
28 // Starts the API call. | 28 // Starts the API call. |
29 // context: The URL context used to make the request. | 29 // context: The URL context used to make the request. |
30 // access_token: The access token for whom to make the to make the request. | 30 // access_token: The access token for whom to make the to make the request. |
31 // serialized_request: A serialized proto containing the request data. | 31 // serialized_request: A serialized proto containing the request data. |
32 // result_callback: Called when the flow completes successfully with a | 32 // result_callback: Called when the flow completes successfully with a |
33 // serialized response proto. | 33 // serialized response proto. |
34 // error_callback: Called when the flow completes with an error. | 34 // error_callback: Called when the flow completes with an error. |
35 void Start(net::URLRequestContextGetter* context, | 35 virtual void Start(net::URLRequestContextGetter* context, |
36 const std::string& access_token, | 36 const std::string& access_token, |
37 const std::string& serialized_request, | 37 const std::string& serialized_request, |
38 ResultCallback result_callback, | 38 const ResultCallback& result_callback, |
39 ErrorCallback error_callback); | 39 const ErrorCallback& error_callback); |
40 | 40 |
41 protected: | 41 protected: |
42 // Reduce the visibility of OAuth2ApiCallFlow::Start() to avoid exposing | 42 // Reduce the visibility of OAuth2ApiCallFlow::Start() to avoid exposing |
43 // overloaded methods. | 43 // overloaded methods. |
44 using OAuth2ApiCallFlow::Start; | 44 using OAuth2ApiCallFlow::Start; |
45 | 45 |
46 // google_apis::OAuth2ApiCallFlow: | 46 // google_apis::OAuth2ApiCallFlow: |
47 GURL CreateApiCallUrl() override; | 47 GURL CreateApiCallUrl() override; |
48 std::string CreateApiCallBody() override; | 48 std::string CreateApiCallBody() override; |
49 std::string CreateApiCallBodyContentType() override; | 49 std::string CreateApiCallBodyContentType() override; |
(...skipping 13 matching lines...) Expand all Loading... |
63 | 63 |
64 // Callback invoked with an error message when the flow fails. | 64 // Callback invoked with an error message when the flow fails. |
65 ErrorCallback error_callback_; | 65 ErrorCallback error_callback_; |
66 | 66 |
67 DISALLOW_COPY_AND_ASSIGN(CryptAuthApiCallFlow); | 67 DISALLOW_COPY_AND_ASSIGN(CryptAuthApiCallFlow); |
68 }; | 68 }; |
69 | 69 |
70 } // namespace proximity_auth | 70 } // namespace proximity_auth |
71 | 71 |
72 #endif // COMPONENTS_PROXIMITY_AUTH_CRYPTAUTH_API_CALL_FLOW_H | 72 #endif // COMPONENTS_PROXIMITY_AUTH_CRYPTAUTH_API_CALL_FLOW_H |
OLD | NEW |