| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 NET_HTTP_HTTP_AUTH_CONTROLLER_H_ | 5 #ifndef NET_HTTP_HTTP_AUTH_CONTROLLER_H_ |
| 6 #define NET_HTTP_HTTP_AUTH_CONTROLLER_H_ | 6 #define NET_HTTP_HTTP_AUTH_CONTROLLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 // otherwise. It may also populate |auth_info_|. | 56 // otherwise. It may also populate |auth_info_|. |
| 57 virtual int HandleAuthChallenge(scoped_refptr<HttpResponseHeaders> headers, | 57 virtual int HandleAuthChallenge(scoped_refptr<HttpResponseHeaders> headers, |
| 58 bool do_not_send_server_auth, | 58 bool do_not_send_server_auth, |
| 59 bool establishing_tunnel, | 59 bool establishing_tunnel, |
| 60 const BoundNetLog& net_log); | 60 const BoundNetLog& net_log); |
| 61 | 61 |
| 62 // Store the supplied credentials and prepare to restart the auth. | 62 // Store the supplied credentials and prepare to restart the auth. |
| 63 virtual void ResetAuth(const string16& username, | 63 virtual void ResetAuth(const string16& username, |
| 64 const string16& password); | 64 const string16& password); |
| 65 | 65 |
| 66 virtual bool HaveAuthHandler() const { | 66 virtual bool HaveAuthHandler() const; |
| 67 return handler_.get() != NULL; | |
| 68 } | |
| 69 | 67 |
| 70 virtual bool HaveAuth() const { | 68 virtual bool HaveAuth() const; |
| 71 return handler_.get() && !identity_.invalid; | |
| 72 } | |
| 73 | 69 |
| 74 virtual scoped_refptr<AuthChallengeInfo> auth_info(); | 70 virtual scoped_refptr<AuthChallengeInfo> auth_info(); |
| 75 | 71 |
| 76 virtual bool IsAuthSchemeDisabled(const std::string& scheme) const; | 72 virtual bool IsAuthSchemeDisabled(const std::string& scheme) const; |
| 77 virtual void DisableAuthScheme(const std::string& scheme); | 73 virtual void DisableAuthScheme(const std::string& scheme); |
| 78 | 74 |
| 79 private: | 75 private: |
| 80 // So that we can mock this object. | 76 // So that we can mock this object. |
| 81 friend class base::RefCounted<HttpAuthController>; | 77 friend class base::RefCounted<HttpAuthController>; |
| 82 | 78 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 | 148 |
| 153 std::set<std::string> disabled_schemes_; | 149 std::set<std::string> disabled_schemes_; |
| 154 | 150 |
| 155 CompletionCallbackImpl<HttpAuthController> io_callback_; | 151 CompletionCallbackImpl<HttpAuthController> io_callback_; |
| 156 CompletionCallback* user_callback_; | 152 CompletionCallback* user_callback_; |
| 157 }; | 153 }; |
| 158 | 154 |
| 159 } // namespace net | 155 } // namespace net |
| 160 | 156 |
| 161 #endif // NET_HTTP_HTTP_AUTH_CONTROLLER_H_ | 157 #endif // NET_HTTP_HTTP_AUTH_CONTROLLER_H_ |
| OLD | NEW |