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_CLIENT_IMPL_H | 5 #ifndef COMPONENTS_PROXIMITY_AUTH_CRYPTAUTH_CLIENT_IMPL_H |
6 #define COMPONENTS_PROXIMITY_AUTH_CRYPTAUTH_CLIENT_IMPL_H | 6 #define COMPONENTS_PROXIMITY_AUTH_CRYPTAUTH_CLIENT_IMPL_H |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "components/proximity_auth/cryptauth/cryptauth_access_token_fetcher.h" | 10 #include "components/cryptauth/cryptauth_access_token_fetcher.h" |
11 #include "components/proximity_auth/cryptauth/cryptauth_api_call_flow.h" | 11 #include "components/cryptauth/cryptauth_api_call_flow.h" |
12 #include "components/proximity_auth/cryptauth/cryptauth_client.h" | 12 #include "components/cryptauth/cryptauth_client.h" |
13 #include "components/proximity_auth/cryptauth/proto/cryptauth_api.pb.h" | 13 #include "components/cryptauth/proto/cryptauth_api.pb.h" |
14 #include "net/url_request/url_request_context_getter.h" | 14 #include "net/url_request/url_request_context_getter.h" |
15 | 15 |
16 class OAuth2TokenService; | 16 class OAuth2TokenService; |
17 | 17 |
18 namespace proximity_auth { | 18 namespace cryptauth { |
19 | 19 |
20 // Implementation of CryptAuthClient. | 20 // Implementation of CryptAuthClient. |
21 // Note: There is no need to set the |device_classifier| field in request | 21 // Note: There is no need to set the |device_classifier| field in request |
22 // messages. CryptAuthClient will fill this field for all requests. | 22 // messages. CryptAuthClient will fill this field for all requests. |
23 class CryptAuthClientImpl : public CryptAuthClient { | 23 class CryptAuthClientImpl : public CryptAuthClient { |
24 public: | 24 public: |
25 typedef base::Callback<void(const std::string&)> ErrorCallback; | 25 typedef base::Callback<void(const std::string&)> ErrorCallback; |
26 | 26 |
27 // Creates the client using |url_request_context| to make the HTTP request | 27 // Creates the client using |url_request_context| to make the HTTP request |
28 // through |api_call_flow|. CryptAuthClientImpl takes ownership of | 28 // through |api_call_flow|. CryptAuthClientImpl takes ownership of |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 138 |
139 private: | 139 private: |
140 OAuth2TokenService* token_service_; | 140 OAuth2TokenService* token_service_; |
141 const std::string account_id_; | 141 const std::string account_id_; |
142 const scoped_refptr<net::URLRequestContextGetter> url_request_context_; | 142 const scoped_refptr<net::URLRequestContextGetter> url_request_context_; |
143 const cryptauth::DeviceClassifier device_classifier_; | 143 const cryptauth::DeviceClassifier device_classifier_; |
144 | 144 |
145 DISALLOW_COPY_AND_ASSIGN(CryptAuthClientFactoryImpl); | 145 DISALLOW_COPY_AND_ASSIGN(CryptAuthClientFactoryImpl); |
146 }; | 146 }; |
147 | 147 |
148 } // namespace proximity_auth | 148 } // namespace cryptauth |
149 | 149 |
150 #endif // COMPONENTS_PROXIMITY_AUTH_CRYPTAUTH_CLIENT_IMPL_H | 150 #endif // COMPONENTS_PROXIMITY_AUTH_CRYPTAUTH_CLIENT_IMPL_H |
OLD | NEW |