| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef REMOTING_PROTOCOL_THIRD_PARTY_CLIENT_AUTHENTICATOR_H_ | 5 #ifndef REMOTING_PROTOCOL_THIRD_PARTY_CLIENT_AUTHENTICATOR_H_ |
| 6 #define REMOTING_PROTOCOL_THIRD_PARTY_CLIENT_AUTHENTICATOR_H_ | 6 #define REMOTING_PROTOCOL_THIRD_PARTY_CLIENT_AUTHENTICATOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 virtual void FetchThirdPartyToken( | 51 virtual void FetchThirdPartyToken( |
| 52 const GURL& token_url, | 52 const GURL& token_url, |
| 53 const std::string& scope, | 53 const std::string& scope, |
| 54 const TokenFetchedCallback& token_fetched_callback) = 0; | 54 const TokenFetchedCallback& token_fetched_callback) = 0; |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 // Creates a third-party client authenticator for the host with the given | 57 // Creates a third-party client authenticator for the host with the given |
| 58 // |host_public_key|. |token_fetcher| is used to get the authentication token. | 58 // |host_public_key|. |token_fetcher| is used to get the authentication token. |
| 59 explicit ThirdPartyClientAuthenticator( | 59 explicit ThirdPartyClientAuthenticator( |
| 60 scoped_ptr<TokenFetcher> token_fetcher); | 60 scoped_ptr<TokenFetcher> token_fetcher); |
| 61 virtual ~ThirdPartyClientAuthenticator(); | 61 ~ThirdPartyClientAuthenticator() override; |
| 62 | 62 |
| 63 protected: | 63 protected: |
| 64 // ThirdPartyAuthenticator implementation. | 64 // ThirdPartyAuthenticator implementation. |
| 65 virtual void ProcessTokenMessage( | 65 void ProcessTokenMessage(const buzz::XmlElement* message, |
| 66 const buzz::XmlElement* message, | 66 const base::Closure& resume_callback) override; |
| 67 const base::Closure& resume_callback) override; | 67 void AddTokenElements(buzz::XmlElement* message) override; |
| 68 virtual void AddTokenElements(buzz::XmlElement* message) override; | |
| 69 | 68 |
| 70 private: | 69 private: |
| 71 void OnThirdPartyTokenFetched(const base::Closure& resume_callback, | 70 void OnThirdPartyTokenFetched(const base::Closure& resume_callback, |
| 72 const std::string& third_party_token, | 71 const std::string& third_party_token, |
| 73 const std::string& shared_secret); | 72 const std::string& shared_secret); |
| 74 | 73 |
| 75 std::string token_; | 74 std::string token_; |
| 76 scoped_ptr<TokenFetcher> token_fetcher_; | 75 scoped_ptr<TokenFetcher> token_fetcher_; |
| 77 | 76 |
| 78 DISALLOW_COPY_AND_ASSIGN(ThirdPartyClientAuthenticator); | 77 DISALLOW_COPY_AND_ASSIGN(ThirdPartyClientAuthenticator); |
| 79 }; | 78 }; |
| 80 | 79 |
| 81 | 80 |
| 82 } // namespace protocol | 81 } // namespace protocol |
| 83 } // namespace remoting | 82 } // namespace remoting |
| 84 | 83 |
| 85 #endif // REMOTING_PROTOCOL_THIRD_PARTY_CLIENT_AUTHENTICATOR_H_ | 84 #endif // REMOTING_PROTOCOL_THIRD_PARTY_CLIENT_AUTHENTICATOR_H_ |
| OLD | NEW |