OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_NEGOTIATING_AUTHENTICATOR_BASE_H_ | 5 #ifndef REMOTING_PROTOCOL_NEGOTIATING_AUTHENTICATOR_BASE_H_ |
6 #define REMOTING_PROTOCOL_NEGOTIATING_AUTHENTICATOR_BASE_H_ | 6 #define REMOTING_PROTOCOL_NEGOTIATING_AUTHENTICATOR_BASE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 return current_method_; | 78 return current_method_; |
79 } | 79 } |
80 | 80 |
81 protected: | 81 protected: |
82 static const buzz::StaticQName kMethodAttributeQName; | 82 static const buzz::StaticQName kMethodAttributeQName; |
83 static const buzz::StaticQName kSupportedMethodsAttributeQName; | 83 static const buzz::StaticQName kSupportedMethodsAttributeQName; |
84 static const char kSupportedMethodsSeparator; | 84 static const char kSupportedMethodsSeparator; |
85 | 85 |
86 explicit NegotiatingAuthenticatorBase(Authenticator::State initial_state); | 86 explicit NegotiatingAuthenticatorBase(Authenticator::State initial_state); |
87 | 87 |
88 void AddMethod(const AuthenticationMethod& method); | 88 void AddMethod(AuthenticationMethod method); |
89 | 89 |
90 // Updates |state_| to reflect the current underlying authenticator state. | 90 // Updates |state_| to reflect the current underlying authenticator state. |
91 // |resume_callback| is called after the state is updated. | 91 // |resume_callback| is called after the state is updated. |
92 void UpdateState(const base::Closure& resume_callback); | 92 void UpdateState(const base::Closure& resume_callback); |
93 | 93 |
94 // Gets the next message from |current_authenticator_|, if any, and fills in | 94 // Gets the next message from |current_authenticator_|, if any, and fills in |
95 // the 'method' tag with |current_method_|. | 95 // the 'method' tag with |current_method_|. |
96 virtual scoped_ptr<buzz::XmlElement> GetNextMessageInternal(); | 96 virtual scoped_ptr<buzz::XmlElement> GetNextMessageInternal(); |
97 | 97 |
98 std::vector<AuthenticationMethod> methods_; | 98 std::vector<AuthenticationMethod> methods_; |
99 AuthenticationMethod current_method_; | 99 AuthenticationMethod current_method_ = AuthenticationMethod::INVALID; |
100 scoped_ptr<Authenticator> current_authenticator_; | 100 scoped_ptr<Authenticator> current_authenticator_; |
101 State state_; | 101 State state_; |
102 RejectionReason rejection_reason_; | 102 RejectionReason rejection_reason_ = INVALID_CREDENTIALS; |
103 | 103 |
104 private: | 104 private: |
105 DISALLOW_COPY_AND_ASSIGN(NegotiatingAuthenticatorBase); | 105 DISALLOW_COPY_AND_ASSIGN(NegotiatingAuthenticatorBase); |
106 }; | 106 }; |
107 | 107 |
108 } // namespace protocol | 108 } // namespace protocol |
109 } // namespace remoting | 109 } // namespace remoting |
110 | 110 |
111 #endif // REMOTING_PROTOCOL_NEGOTIATING_AUTHENTICATOR_BASE_H_ | 111 #endif // REMOTING_PROTOCOL_NEGOTIATING_AUTHENTICATOR_BASE_H_ |
OLD | NEW |