Probably broke Win7 Tests (dbg)(6). http://build.chromium.org/p/chromium.win/builders...
[chromium-blink-merge.git] / net / http / http_auth_handler_basic.h
blob5d786f9de8617bec178f256454aa545a6585fc17
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
3 // found in the LICENSE file.
5 #ifndef NET_HTTP_HTTP_AUTH_HANDLER_BASIC_H_
6 #define NET_HTTP_HTTP_AUTH_HANDLER_BASIC_H_
8 #include <string>
10 #include "net/base/net_export.h"
11 #include "net/http/http_auth_handler.h"
12 #include "net/http/http_auth_handler_factory.h"
14 namespace net {
16 // Code for handling http basic authentication.
17 class NET_EXPORT_PRIVATE HttpAuthHandlerBasic : public HttpAuthHandler {
18 public:
19 class NET_EXPORT_PRIVATE Factory : public HttpAuthHandlerFactory {
20 public:
21 Factory();
22 virtual ~Factory();
24 virtual int CreateAuthHandler(
25 HttpAuthChallengeTokenizer* challenge,
26 HttpAuth::Target target,
27 const GURL& origin,
28 CreateReason reason,
29 int digest_nonce_count,
30 const BoundNetLog& net_log,
31 scoped_ptr<HttpAuthHandler>* handler) OVERRIDE;
34 virtual HttpAuth::AuthorizationResult HandleAnotherChallenge(
35 HttpAuthChallengeTokenizer* challenge) OVERRIDE;
37 protected:
38 virtual bool Init(HttpAuthChallengeTokenizer* challenge) OVERRIDE;
40 virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials,
41 const HttpRequestInfo* request,
42 const CompletionCallback& callback,
43 std::string* auth_token) OVERRIDE;
45 private:
46 virtual ~HttpAuthHandlerBasic() {}
48 bool ParseChallenge(HttpAuthChallengeTokenizer* challenge);
51 } // namespace net
53 #endif // NET_HTTP_HTTP_AUTH_HANDLER_BASIC_H_