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

Side by Side 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, 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef REMOTING_CLIENT_JNI_JNI_TOKEN_FETCHER_H_
6 #define REMOTING_CLIENT_JNI_JNI_TOKEN_FETCHER_H_
7
8 #include "base/callback.h"
9 #include "base/memory/weak_ptr.h"
10 #include "remoting/protocol/third_party_client_authenticator.h"
11
12 namespace remoting {
13
14 class ChromotingJniInstance;
15
16 // JniTokenFetcher is used by the ThirdPartyClientAuthenticator to fetch the
17 // access code and token from the android app via JNI.
18 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.
19 : public protocol::ThirdPartyClientAuthenticator::TokenFetcher {
20 public:
21 JniTokenFetcher(base::WeakPtr<ChromotingJniInstance> jni_instance,
22 const std::string& host_public_key);
23 virtual ~JniTokenFetcher();
24
25 // protocol::TokenClientAuthenticator::TokenFetcher interface.
26 virtual void FetchThirdPartyToken(
27 const GURL& token_url,
28 const std::string& scope,
29 const TokenFetchedCallback& token_fetched_callback) OVERRIDE;
30
31 // Called by ChromotingJniInstance when the android app finishes fetching the
32 // token.
33 void OnTokenFetched(const std::string& token,
34 const std::string& shared_secret);
35
36 private:
37 base::WeakPtr<ChromotingJniInstance> jni_instance_;
38 std::string client_id_;
39 TokenFetchedCallback token_fetched_callback_;
40 base::WeakPtrFactory<JniTokenFetcher> weak_factory_;
41
42 DISALLOW_COPY_AND_ASSIGN(JniTokenFetcher);
43 };
44
45 } // namespace remoting
46
47 #endif // REMOTING_CLIENT_JNI_JNI_TOKEN_FETCHER_H_
OLDNEW
« 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