| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_HANDLER_BASIC_H_ | 5 #ifndef NET_HTTP_HTTP_AUTH_HANDLER_BASIC_H_ |
| 6 #define NET_HTTP_HTTP_AUTH_HANDLER_BASIC_H_ | 6 #define NET_HTTP_HTTP_AUTH_HANDLER_BASIC_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "net/base/net_export.h" | 11 #include "net/base/net_export.h" |
| 12 #include "net/http/http_auth_handler.h" | 12 #include "net/http/http_auth_handler.h" |
| 13 #include "net/http/http_auth_handler_factory.h" | 13 #include "net/http/http_auth_handler_factory.h" |
| 14 | 14 |
| 15 namespace net { | 15 namespace net { |
| 16 | 16 |
| 17 // Code for handling http basic authentication. | 17 // Code for handling http basic authentication. |
| 18 class NET_EXPORT_PRIVATE HttpAuthHandlerBasic : public HttpAuthHandler { | 18 class NET_EXPORT_PRIVATE HttpAuthHandlerBasic : public HttpAuthHandler { |
| 19 public: | 19 public: |
| 20 class NET_EXPORT_PRIVATE Factory : public HttpAuthHandlerFactory { | 20 class NET_EXPORT_PRIVATE Factory : public HttpAuthHandlerFactory { |
| 21 public: | 21 public: |
| 22 Factory(); | 22 Factory(); |
| 23 virtual ~Factory(); | 23 virtual ~Factory(); |
| 24 | 24 |
| 25 virtual int CreateAuthHandler(HttpAuth::ChallengeTokenizer* challenge, | 25 virtual int CreateAuthHandler( |
| 26 HttpAuth::Target target, | 26 HttpAuth::ChallengeTokenizer* challenge, |
| 27 const GURL& origin, | 27 HttpAuth::Target target, |
| 28 CreateReason reason, | 28 const GURL& origin, |
| 29 int digest_nonce_count, | 29 CreateReason reason, |
| 30 const BoundNetLog& net_log, | 30 int digest_nonce_count, |
| 31 scoped_ptr<HttpAuthHandler>* handler); | 31 const BoundNetLog& net_log, |
| 32 scoped_ptr<HttpAuthHandler>* handler) OVERRIDE; |
| 32 }; | 33 }; |
| 33 | 34 |
| 34 virtual HttpAuth::AuthorizationResult HandleAnotherChallenge( | 35 virtual HttpAuth::AuthorizationResult HandleAnotherChallenge( |
| 35 HttpAuth::ChallengeTokenizer* challenge); | 36 HttpAuth::ChallengeTokenizer* challenge) OVERRIDE; |
| 36 | 37 |
| 37 protected: | 38 protected: |
| 38 virtual bool Init(HttpAuth::ChallengeTokenizer* challenge); | 39 virtual bool Init(HttpAuth::ChallengeTokenizer* challenge) OVERRIDE; |
| 39 | 40 |
| 40 virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials, | 41 virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials, |
| 41 const HttpRequestInfo* request, | 42 const HttpRequestInfo* request, |
| 42 OldCompletionCallback* callback, | 43 OldCompletionCallback* callback, |
| 43 std::string* auth_token); | 44 std::string* auth_token) OVERRIDE; |
| 44 | 45 |
| 45 private: | 46 private: |
| 46 virtual ~HttpAuthHandlerBasic() {} | 47 virtual ~HttpAuthHandlerBasic() {} |
| 47 | 48 |
| 48 bool ParseChallenge(HttpAuth::ChallengeTokenizer* challenge); | 49 bool ParseChallenge(HttpAuth::ChallengeTokenizer* challenge); |
| 49 }; | 50 }; |
| 50 | 51 |
| 51 } // namespace net | 52 } // namespace net |
| 52 | 53 |
| 53 #endif // NET_HTTP_HTTP_AUTH_HANDLER_BASIC_H_ | 54 #endif // NET_HTTP_HTTP_AUTH_HANDLER_BASIC_H_ |
| OLD | NEW |