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

Side by Side Diff: components/proximity_auth/cryptauth/cryptauth_access_token_fetcher.h

Issue 1066453002: Refactor CryptAuth component to be more testable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cryptauth_securemessage
Patch Set: moved classes to impl files 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
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_CRYPT_AUTH_ACCESS_TOKEN_FETCHER_H 5 #ifndef COMPONENTS_PROXIMITY_AUTH_CRYPT_AUTH_ACCESS_TOKEN_FETCHER_H
6 #define COMPONENTS_PROXIMITY_AUTH_CRYPT_AUTH_ACCESS_TOKEN_FETCHER_H 6 #define COMPONENTS_PROXIMITY_AUTH_CRYPT_AUTH_ACCESS_TOKEN_FETCHER_H
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
11 #include "base/memory/scoped_ptr.h"
Ilya Sherman 2015/04/06 23:48:01 nit: Not needed?
Tim Song 2015/04/07 02:22:56 Done.
11 12
12 namespace proximity_auth { 13 namespace proximity_auth {
13 14
14 // Simple interface for fetching the OAuth2 access token that authorizes 15 // Simple interface for fetching the OAuth2 access token that authorizes
15 // CryptAuth API calls. Do not reuse this after calling FetchAccessToken(); 16 // CryptAuth API calls. Do not reuse this after calling FetchAccessToken();
16 // instead, create a new instance. 17 // instead, create a new instance.
17 class CryptAuthAccessTokenFetcher { 18 class CryptAuthAccessTokenFetcher {
18 public: 19 public:
19 virtual ~CryptAuthAccessTokenFetcher() {} 20 virtual ~CryptAuthAccessTokenFetcher() {}
20 21
21 // Fetches the access token asynchronously, invoking the callback upon 22 // Fetches the access token asynchronously, invoking the callback upon
22 // completion. If the fetch fails, the callback will be invoked with an empty 23 // completion. If the fetch fails, the callback will be invoked with an empty
23 // string. 24 // string.
24 typedef base::Callback<void(const std::string&)> AccessTokenCallback; 25 typedef base::Callback<void(const std::string&)> AccessTokenCallback;
25 virtual void FetchAccessToken(const AccessTokenCallback& callback) = 0; 26 virtual void FetchAccessToken(const AccessTokenCallback& callback) = 0;
26 }; 27 };
27 28
28 } // namespace proximity_auth 29 } // namespace proximity_auth
29 30
30 #endif // COMPONENTS_PROXIMITY_AUTH_CRYPT_AUTH_ACCESS_TOKEN_FETCHER_H 31 #endif // COMPONENTS_PROXIMITY_AUTH_CRYPT_AUTH_ACCESS_TOKEN_FETCHER_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698