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_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> |
| 10 |
| 11 #include "base/string16.h" |
9 #include "net/http/http_auth_handler.h" | 12 #include "net/http/http_auth_handler.h" |
10 #include "net/http/http_auth_handler_factory.h" | 13 #include "net/http/http_auth_handler_factory.h" |
11 | 14 |
12 namespace net { | 15 namespace net { |
13 | 16 |
14 // Code for handling http basic authentication. | 17 // Code for handling http basic authentication. |
15 class HttpAuthHandlerBasic : public HttpAuthHandler { | 18 class HttpAuthHandlerBasic : public HttpAuthHandler { |
16 public: | 19 public: |
17 class Factory : public HttpAuthHandlerFactory { | 20 class Factory : public HttpAuthHandlerFactory { |
18 public: | 21 public: |
19 Factory(); | 22 Factory(); |
20 virtual ~Factory(); | 23 virtual ~Factory(); |
21 | 24 |
22 virtual int CreateAuthHandler(HttpAuth::ChallengeTokenizer* challenge, | 25 virtual int CreateAuthHandler(HttpAuth::ChallengeTokenizer* challenge, |
23 HttpAuth::Target target, | 26 HttpAuth::Target target, |
24 const GURL& origin, | 27 const GURL& origin, |
25 CreateReason reason, | 28 CreateReason reason, |
26 int digest_nonce_count, | 29 int digest_nonce_count, |
27 const BoundNetLog& net_log, | 30 const BoundNetLog& net_log, |
28 scoped_ptr<HttpAuthHandler>* handler); | 31 scoped_ptr<HttpAuthHandler>* handler); |
29 }; | 32 }; |
30 | 33 |
31 protected: | 34 protected: |
32 virtual bool Init(HttpAuth::ChallengeTokenizer* challenge); | 35 virtual bool Init(HttpAuth::ChallengeTokenizer* challenge); |
33 | 36 |
34 virtual int GenerateAuthTokenImpl(const std::wstring* username, | 37 virtual int GenerateAuthTokenImpl(const string16* username, |
35 const std::wstring* password, | 38 const string16* password, |
36 const HttpRequestInfo* request, | 39 const HttpRequestInfo* request, |
37 CompletionCallback* callback, | 40 CompletionCallback* callback, |
38 std::string* auth_token); | 41 std::string* auth_token); |
39 | 42 |
40 private: | 43 private: |
41 ~HttpAuthHandlerBasic() {} | 44 ~HttpAuthHandlerBasic() {} |
42 }; | 45 }; |
43 | 46 |
44 } // namespace net | 47 } // namespace net |
45 | 48 |
46 #endif // NET_HTTP_HTTP_AUTH_HANDLER_BASIC_H_ | 49 #endif // NET_HTTP_HTTP_AUTH_HANDLER_BASIC_H_ |
OLD | NEW |