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

Unified Diff: remoting/client/jni/jni_token_fetcher.h

Issue 311983003: Third Party Authentication for Android Part I - TokenFetcherProxy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: JNI Token Fetcher Created 6 years, 7 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/jni/chromoting_jni_instance.cc ('k') | remoting/client/jni/jni_token_fetcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/jni/jni_token_fetcher.h
diff --git a/remoting/client/jni/jni_token_fetcher.h b/remoting/client/jni/jni_token_fetcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..e8af19f2763b652094094636e71c06e51d767d56
--- /dev/null
+++ b/remoting/client/jni/jni_token_fetcher.h
@@ -0,0 +1,47 @@
+// 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_JNI_JNI_TOKEN_FETCHER_H_
+#define REMOTING_CLIENT_JNI_JNI_TOKEN_FETCHER_H_
+
+#include "base/callback.h"
+#include "base/memory/weak_ptr.h"
+#include "remoting/protocol/third_party_client_authenticator.h"
+
+namespace remoting {
+
+class ChromotingJniInstance;
+
+// JniTokenFetcher is used by the ThirdPartyClientAuthenticator to fetch the
+// access code and token from the android app via JNI.
+class JniTokenFetcher
Sergey Ulanov 2014/06/04 03:49:17 This looks a lot like PepperTokenFetcher. I think
kelvinp 2014/06/04 21:13:53 Done.
+ : public protocol::ThirdPartyClientAuthenticator::TokenFetcher {
+ public:
+ JniTokenFetcher(base::WeakPtr<ChromotingJniInstance> jni_instance,
+ const std::string& host_public_key);
+ virtual ~JniTokenFetcher();
+
+ // protocol::TokenClientAuthenticator::TokenFetcher interface.
+ virtual void FetchThirdPartyToken(
+ const GURL& token_url,
+ const std::string& scope,
+ const TokenFetchedCallback& token_fetched_callback) OVERRIDE;
+
+ // Called by ChromotingJniInstance when the android app finishes fetching the
+ // token.
+ void OnTokenFetched(const std::string& token,
+ const std::string& shared_secret);
+
+ private:
+ base::WeakPtr<ChromotingJniInstance> jni_instance_;
+ std::string client_id_;
+ TokenFetchedCallback token_fetched_callback_;
+ base::WeakPtrFactory<JniTokenFetcher> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(JniTokenFetcher);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_CLIENT_JNI_JNI_TOKEN_FETCHER_H_
« no previous file with comments | « remoting/client/jni/chromoting_jni_instance.cc ('k') | remoting/client/jni/jni_token_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698