Index: components/proximity_auth/cryptauth/cryptauth_access_token_fetcher.h |
diff --git a/components/proximity_auth/cryptauth/cryptauth_access_token_fetcher.h b/components/proximity_auth/cryptauth/cryptauth_access_token_fetcher.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..04dbe2f5e43f0c9b3c18b8cd44ebd3570c97a9d6 |
--- /dev/null |
+++ b/components/proximity_auth/cryptauth/cryptauth_access_token_fetcher.h |
@@ -0,0 +1,25 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef COMPONENTS_PROXIMITY_AUTH_CRYPT_AUTH_ACCESS_TOKEN_FETCHER_H |
+#define COMPONENTS_PROXIMITY_AUTH_CRYPT_AUTH_ACCESS_TOKEN_FETCHER_H |
+ |
+namespace proximity_auth { |
+ |
+// Simple interface for fetching the OAuth2 access token that authorizes |
+// CryptAuth API calls. |
+class CryptAuthAccessTokenFetcher { |
+ public: |
+ virtual ~CryptAuthAccessTokenFetcher() {} |
+ |
+ // Fetches the access token asynchronously, invoking the callback upon |
+ // completion. If the fetch fails, the callback will be invoked with an empty |
+ // string. |
+ typedef base::Callback<void(const std::string&)> AccessTokenCallback; |
+ virtual void FetchAccessToken(const AccessTokenCallback& callback) = 0; |
+}; |
+ |
+} // namespace proximity_auth |
+ |
+#endif // COMPONENTS_PROXIMITY_AUTH_CRYPT_AUTH_ACCESS_TOKEN_FETCHER_H |