Chromium Code Reviews| OLD | NEW |
|---|---|
| (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_ | |
| OLD | NEW |