OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef REMOTING_CLIENT_PLUGIN_PEPPER_TOKEN_FETCHER_H_ | |
6 #define REMOTING_CLIENT_PLUGIN_PEPPER_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 ChromotingInstance; | |
15 | |
16 class PepperTokenFetcher | |
17 : public protocol::ThirdPartyClientAuthenticator::TokenFetcher { | |
18 public: | |
19 explicit PepperTokenFetcher(base::WeakPtr<ChromotingInstance> plugin, | |
Sergey Ulanov
2013/04/05 18:34:57
remove explicit.
rmsousa
2013/04/06 01:11:03
Done.
| |
20 const std::string& host_public_key); | |
21 virtual ~PepperTokenFetcher() OVERRIDE; | |
22 | |
23 // protocol::TokenClientAuthenticator::TokenFetcher interface. | |
24 virtual void FetchThirdPartyToken( | |
25 const GURL& token_url, | |
26 const std::string& scope, | |
27 const TokenFetchedCallback& token_fetched_callback) OVERRIDE; | |
28 | |
29 // Called by ChromotingInstance when the webapp finishes fetching the token. | |
30 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.
| |
31 const std::string& shared_secret); | |
32 | |
33 private: | |
34 base::WeakPtr<ChromotingInstance> plugin_; | |
35 std::string host_public_key_; | |
36 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
| |
37 TokenFetchedCallback token_fetched_callback_; | |
38 | |
39 DISALLOW_COPY_AND_ASSIGN(PepperTokenFetcher); | |
40 }; | |
41 | |
42 } // namespace remoting | |
43 | |
44 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_TOKEN_FETCHER_H_ | |
OLD | NEW |