Revert of Revert of Roll android_tools f6e2370:2a860d8 (patchset #1 id:1 of https...
[chromium-blink-merge.git] / remoting / protocol / pairing_client_authenticator.h
blob1696073859cb4cd0e793ebbe3c5ca51952eb9896
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.
5 #ifndef REMOTING_PROTOCOL_PAIRING_CLIENT_AUTHENTICATOR_H_
6 #define REMOTING_PROTOCOL_PAIRING_CLIENT_AUTHENTICATOR_H_
8 #include "base/memory/weak_ptr.h"
9 #include "remoting/protocol/pairing_authenticator_base.h"
11 namespace remoting {
12 namespace protocol {
14 class PairingClientAuthenticator : public PairingAuthenticatorBase {
15 public:
16 PairingClientAuthenticator(
17 const std::string& client_id,
18 const std::string& paired_secret,
19 const FetchSecretCallback& fetch_pin_callback,
20 const std::string& authentication_tag);
21 ~PairingClientAuthenticator() override;
23 private:
24 // PairingAuthenticatorBase interface.
25 void CreateV2AuthenticatorWithPIN(
26 State initial_state,
27 const SetAuthenticatorCallback& callback) override;
28 void AddPairingElements(buzz::XmlElement* message) override;
30 void OnPinFetched(State initial_state,
31 const SetAuthenticatorCallback& callback,
32 const std::string& pin);
34 // Protocol state.
35 bool sent_client_id_;
36 std::string client_id_;
37 const std::string& paired_secret_;
38 FetchSecretCallback fetch_pin_callback_;
39 std::string authentication_tag_;
41 base::WeakPtrFactory<PairingClientAuthenticator> weak_factory_;
43 DISALLOW_COPY_AND_ASSIGN(PairingClientAuthenticator);
46 } // namespace protocol
47 } // namespace remoting
49 #endif // REMOTING_PROTOCOL_PAIRING_AUTHENTICATOR_H_