Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Side by Side Diff: components/proximity_auth/cryptauth/cryptauth_client_factory.cc

Issue 1066453002: Refactor CryptAuth component to be more testable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cryptauth_securemessage
Patch Set: rename tests Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/proximity_auth/cryptauth/cryptauth_client_factory.h"
6
7 #include "components/proximity_auth/cryptauth/cryptauth_account_token_fetcher.h"
8
9 namespace proximity_auth {
10
11 CryptAuthClientFactory::CryptAuthClientFactory(
12 OAuth2TokenService* token_service,
13 const std::string& account_id,
14 scoped_refptr<net::URLRequestContextGetter> url_request_context,
15 const cryptauth::DeviceClassifier& device_classifier)
16 : token_service_(token_service),
17 account_id_(account_id),
18 url_request_context_(url_request_context),
19 device_classifier_(device_classifier) {
20 }
21
22 CryptAuthClientFactory::~CryptAuthClientFactory() {
23 }
24
25 scoped_ptr<CryptAuthClient> CryptAuthClientFactory::CreateInstance() {
26 scoped_ptr<CryptAuthAccessTokenFetcher> access_token_fetcher(
27 new CryptAuthAccountTokenFetcher(token_service_, account_id_));
28 return make_scoped_ptr(new CryptAuthClient(
29 access_token_fetcher.Pass(), url_request_context_, device_classifier_));
30 }
31
32 } // namespace proximity_auth
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698