| 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 #include "components/proximity_auth/cryptauth/cryptauth_client_impl.h" | 5 #include "components/proximity_auth/cryptauth/cryptauth_client_impl.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/bind.h" | 9 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 9 #include "components/proximity_auth/cryptauth/cryptauth_access_token_fetcher_imp
l.h" | 11 #include "components/proximity_auth/cryptauth/cryptauth_access_token_fetcher_imp
l.h" |
| 10 #include "components/proximity_auth/cryptauth/switches.h" | 12 #include "components/proximity_auth/cryptauth/switches.h" |
| 11 | 13 |
| 12 namespace proximity_auth { | 14 namespace proximity_auth { |
| 13 | 15 |
| 14 namespace { | 16 namespace { |
| 15 | 17 |
| 16 // Default URL of Google APIs endpoint hosting CryptAuth. | 18 // Default URL of Google APIs endpoint hosting CryptAuth. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 43 kQueryProtobuf); | 45 kQueryProtobuf); |
| 44 } | 46 } |
| 45 | 47 |
| 46 } // namespace | 48 } // namespace |
| 47 | 49 |
| 48 CryptAuthClientImpl::CryptAuthClientImpl( | 50 CryptAuthClientImpl::CryptAuthClientImpl( |
| 49 scoped_ptr<CryptAuthApiCallFlow> api_call_flow, | 51 scoped_ptr<CryptAuthApiCallFlow> api_call_flow, |
| 50 scoped_ptr<CryptAuthAccessTokenFetcher> access_token_fetcher, | 52 scoped_ptr<CryptAuthAccessTokenFetcher> access_token_fetcher, |
| 51 scoped_refptr<net::URLRequestContextGetter> url_request_context, | 53 scoped_refptr<net::URLRequestContextGetter> url_request_context, |
| 52 const cryptauth::DeviceClassifier& device_classifier) | 54 const cryptauth::DeviceClassifier& device_classifier) |
| 53 : api_call_flow_(api_call_flow.Pass()), | 55 : api_call_flow_(std::move(api_call_flow)), |
| 54 access_token_fetcher_(access_token_fetcher.Pass()), | 56 access_token_fetcher_(std::move(access_token_fetcher)), |
| 55 url_request_context_(url_request_context), | 57 url_request_context_(url_request_context), |
| 56 device_classifier_(device_classifier), | 58 device_classifier_(device_classifier), |
| 57 has_call_started_(false), | 59 has_call_started_(false), |
| 58 weak_ptr_factory_(this) { | 60 weak_ptr_factory_(this) {} |
| 59 } | |
| 60 | 61 |
| 61 CryptAuthClientImpl::~CryptAuthClientImpl() { | 62 CryptAuthClientImpl::~CryptAuthClientImpl() { |
| 62 } | 63 } |
| 63 | 64 |
| 64 void CryptAuthClientImpl::GetMyDevices( | 65 void CryptAuthClientImpl::GetMyDevices( |
| 65 const cryptauth::GetMyDevicesRequest& request, | 66 const cryptauth::GetMyDevicesRequest& request, |
| 66 const GetMyDevicesCallback& callback, | 67 const GetMyDevicesCallback& callback, |
| 67 const ErrorCallback& error_callback) { | 68 const ErrorCallback& error_callback) { |
| 68 MakeApiCall(kGetMyDevicesPath, request, callback, error_callback); | 69 MakeApiCall(kGetMyDevicesPath, request, callback, error_callback); |
| 69 } | 70 } |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 | 193 |
| 193 scoped_ptr<CryptAuthClient> CryptAuthClientFactoryImpl::CreateInstance() { | 194 scoped_ptr<CryptAuthClient> CryptAuthClientFactoryImpl::CreateInstance() { |
| 194 return make_scoped_ptr(new CryptAuthClientImpl( | 195 return make_scoped_ptr(new CryptAuthClientImpl( |
| 195 make_scoped_ptr(new CryptAuthApiCallFlow()), | 196 make_scoped_ptr(new CryptAuthApiCallFlow()), |
| 196 make_scoped_ptr( | 197 make_scoped_ptr( |
| 197 new CryptAuthAccessTokenFetcherImpl(token_service_, account_id_)), | 198 new CryptAuthAccessTokenFetcherImpl(token_service_, account_id_)), |
| 198 url_request_context_, device_classifier_)); | 199 url_request_context_, device_classifier_)); |
| 199 } | 200 } |
| 200 | 201 |
| 201 } // proximity_auth | 202 } // proximity_auth |
| OLD | NEW |