Chromium Code Reviews| Index: net/http/http_auth_handler_negotiate.h |
| diff --git a/net/http/http_auth_handler_negotiate.h b/net/http/http_auth_handler_negotiate.h |
| index fc596fa6db1e49ea673ed7e7b95b12d106c11381..3a84a41adc151da679d969c64c236985813bb489 100644 |
| --- a/net/http/http_auth_handler_negotiate.h |
| +++ b/net/http/http_auth_handler_negotiate.h |
| @@ -2,8 +2,8 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ |
| -#define NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ |
| +#ifndef NET_ANDROID_HTTP_AUTH_HANDLER_NEGOTIATE_H_ |
| +#define NET_ANDROID_HTTP_AUTH_HANDLER_NEGOTIATE_H_ |
| #include <string> |
| @@ -15,6 +15,8 @@ |
| #if defined(OS_WIN) |
| #include "net/http/http_auth_sspi_win.h" |
| +#elif defined(OS_ANDROID) |
|
Bernhard Bauer
2015/06/10 17:11:03
I think I would rather put these into alphabetic o
aberent
2015/06/15 15:52:20
Done.
|
| +#include "net/android/http_android_auth_negotiate.h" |
| #elif defined(OS_POSIX) |
| #include "net/http/http_auth_gssapi_posix.h" |
| #endif |
| @@ -32,7 +34,9 @@ class URLSecurityManager; |
| class NET_EXPORT_PRIVATE HttpAuthHandlerNegotiate : public HttpAuthHandler { |
| public: |
| -#if defined(OS_WIN) |
| +#if defined(OS_ANDROID) |
| + typedef net::android::AndroidAuthNegotiate AuthSystem; |
| +#elif defined(OS_WIN) |
| typedef SSPILibrary AuthLibrary; |
| typedef HttpAuthSSPI AuthSystem; |
| #elif defined(OS_POSIX) |
| @@ -63,11 +67,18 @@ class NET_EXPORT_PRIVATE HttpAuthHandlerNegotiate : public HttpAuthHandler { |
| void set_host_resolver(HostResolver* host_resolver); |
| +#if defined(OS_ANDROID) |
| + // Sets the account type to use for authentication |
| + void set_account_type(const std::string& account_type) { |
| + account_type_ = account_type; |
| + } |
| +#else |
|
cbentzel
2015/06/11 20:51:43
Should do #endif/#if defined() here - set_account_
aberent
2015/06/15 15:52:20
Done.
|
| // Sets the system library to use, thereby assuming ownership of |
| // |auth_library|. |
| void set_library(AuthLibrary* auth_library) { |
| auth_library_.reset(auth_library); |
| } |
| +#endif |
| int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, |
| HttpAuth::Target target, |
| @@ -86,17 +97,26 @@ class NET_EXPORT_PRIVATE HttpAuthHandlerNegotiate : public HttpAuthHandler { |
| bool first_creation_; |
| #endif |
| bool is_unsupported_; |
| +#if defined(OS_ANDROID) |
| + std::string account_type_; |
| +#else |
| scoped_ptr<AuthLibrary> auth_library_; |
| +#endif |
| }; |
| - HttpAuthHandlerNegotiate(AuthLibrary* sspi_library, |
| + HttpAuthHandlerNegotiate( |
| +#if defined(OS_ANDROID) |
| + std::string account_type, |
| +#else |
| + AuthLibrary* sspi_library, |
| +#endif |
| #if defined(OS_WIN) |
| - ULONG max_token_length, |
| + ULONG max_token_length, |
| #endif |
| - URLSecurityManager* url_security_manager, |
| - HostResolver* host_resolver, |
| - bool disable_cname_lookup, |
| - bool use_port); |
| + URLSecurityManager* url_security_manager, |
| + HostResolver* host_resolver, |
| + bool disable_cname_lookup, |
| + bool use_port); |
| ~HttpAuthHandlerNegotiate() override; |
| @@ -164,4 +184,4 @@ class NET_EXPORT_PRIVATE HttpAuthHandlerNegotiate : public HttpAuthHandler { |
| } // namespace net |
| -#endif // NET_HTTP_HTTP_AUTH_HANDLER_NEGOTIATE_H_ |
| +#endif // NET_ANDROID_HTTP_AUTH_HANDLER_NEGOTIATE_H_ |
|
cbentzel
2015/06/11 20:51:43
Nit: Move back to NET_HTTP_HTTP (and the same for
aberent
2015/06/15 15:52:20
Done.
|