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

Unified Diff: remoting/client/token_fetcher_proxy.h

Issue 311983003: Third Party Authentication for Android Part I - TokenFetcherProxy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressing CR feedbacks Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/client/plugin/pepper_token_fetcher.cc ('k') | remoting/client/token_fetcher_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/token_fetcher_proxy.h
diff --git a/remoting/client/token_fetcher_proxy.h b/remoting/client/token_fetcher_proxy.h
new file mode 100644
index 0000000000000000000000000000000000000000..f7cec09bbca63fcb2495612ccf82460847a31e9d
--- /dev/null
+++ b/remoting/client/token_fetcher_proxy.h
@@ -0,0 +1,48 @@
+// 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 REMOTING_CLIENT_TOKEN_FETCHER_PROXY_H_
+#define REMOTING_CLIENT_TOKEN_FETCHER_PROXY_H_
+
+#include "base/callback.h"
+#include "base/memory/weak_ptr.h"
+#include "remoting/protocol/third_party_client_authenticator.h"
+
+namespace remoting {
+
+class TokenFetcherProxy
+ : public protocol::ThirdPartyClientAuthenticator::TokenFetcher {
+ public:
+ typedef base::Callback<void(
+ const GURL& token_url,
+ const std::string& host_public_key,
+ const std::string& scope,
+ base::WeakPtr<TokenFetcherProxy>)> TokenFetcherCallback;
+
+ TokenFetcherProxy(const TokenFetcherCallback& token_fetcher_impl,
+ const std::string& host_public_key);
+ virtual ~TokenFetcherProxy();
+
+ // protocol::TokenClientAuthenticator::TokenFetcher interface.
+ virtual void FetchThirdPartyToken(
+ const GURL& token_url,
+ const std::string& scope,
+ const TokenFetchedCallback& token_fetched_callback) OVERRIDE;
+
+ // Called by the token fetching implementation when the token is fetched.
+ void OnTokenFetched(const std::string& token,
+ const std::string& shared_secret);
+
+ private:
+ std::string host_public_key_;
+ TokenFetcherCallback token_fetcher_impl_;
+ TokenFetchedCallback token_fetched_callback_;
+ base::WeakPtrFactory<TokenFetcherProxy> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(TokenFetcherProxy);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_CLIENT_TOKEN_FETCHER_PROXY_H_
« no previous file with comments | « remoting/client/plugin/pepper_token_fetcher.cc ('k') | remoting/client/token_fetcher_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698