Chromium Code Reviews| Index: remoting/client/plugin/pepper_token_fetcher.h |
| diff --git a/remoting/client/plugin/pepper_token_fetcher.h b/remoting/client/plugin/pepper_token_fetcher.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..838af0e89dc13dd465d77cb22c088c91136625c4 |
| --- /dev/null |
| +++ b/remoting/client/plugin/pepper_token_fetcher.h |
| @@ -0,0 +1,44 @@ |
| +// Copyright 2013 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_PLUGIN_PEPPER_TOKEN_FETCHER_H_ |
| +#define REMOTING_CLIENT_PLUGIN_PEPPER_TOKEN_FETCHER_H_ |
| + |
| +#include "base/callback.h" |
| +#include "base/memory/weak_ptr.h" |
| +#include "remoting/protocol/third_party_client_authenticator.h" |
| + |
| +namespace remoting { |
| + |
| +class ChromotingInstance; |
| + |
| +class PepperTokenFetcher |
| + : public protocol::ThirdPartyClientAuthenticator::TokenFetcher { |
| + public: |
| + explicit PepperTokenFetcher(base::WeakPtr<ChromotingInstance> plugin, |
|
Sergey Ulanov
2013/04/05 18:34:57
remove explicit.
rmsousa
2013/04/06 01:11:03
Done.
|
| + const std::string& host_public_key); |
| + virtual ~PepperTokenFetcher() OVERRIDE; |
| + |
| + // protocol::TokenClientAuthenticator::TokenFetcher interface. |
| + virtual void FetchThirdPartyToken( |
| + const GURL& token_url, |
| + const std::string& scope, |
| + const TokenFetchedCallback& token_fetched_callback) OVERRIDE; |
| + |
| + // Called by ChromotingInstance when the webapp finishes fetching the token. |
| + virtual void OnTokenFetched(const std::string& token, |
|
Sergey Ulanov
2013/04/05 18:34:57
Does this need to be virtual?
rmsousa
2013/04/06 01:11:03
Done.
|
| + const std::string& shared_secret); |
| + |
| + private: |
| + base::WeakPtr<ChromotingInstance> plugin_; |
| + std::string host_public_key_; |
| + base::WeakPtrFactory<PepperTokenFetcher> weak_factory_; |
|
Sergey Ulanov
2013/04/05 18:34:57
nit: I often doesn't matter, but we usually put we
rmsousa
2013/04/06 01:11:03
Good to know. I had noticed that pattern in our co
|
| + TokenFetchedCallback token_fetched_callback_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(PepperTokenFetcher); |
| +}; |
| + |
| +} // namespace remoting |
| + |
| +#endif // REMOTING_CLIENT_PLUGIN_PEPPER_TOKEN_FETCHER_H_ |