| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "android_webview/browser/net/aw_url_request_context_getter.h" | 5 #include "android_webview/browser/net/aw_url_request_context_getter.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "android_webview/browser/aw_browser_context.h" | 10 #include "android_webview/browser/aw_browser_context.h" |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 request_options()->SetKeyOnIO(key); | 303 request_options()->SetKeyOnIO(key); |
| 304 } | 304 } |
| 305 | 305 |
| 306 scoped_ptr<net::HttpAuthHandlerFactory> | 306 scoped_ptr<net::HttpAuthHandlerFactory> |
| 307 AwURLRequestContextGetter::CreateAuthHandlerFactory( | 307 AwURLRequestContextGetter::CreateAuthHandlerFactory( |
| 308 net::HostResolver* resolver) { | 308 net::HostResolver* resolver) { |
| 309 DCHECK(resolver); | 309 DCHECK(resolver); |
| 310 | 310 |
| 311 // In Chrome this is configurable via the AuthSchemes policy. For WebView | 311 // In Chrome this is configurable via the AuthSchemes policy. For WebView |
| 312 // there is no interest to have it available so far. | 312 // there is no interest to have it available so far. |
| 313 std::vector<std::string> supported_schemes = {"basic", "digest", "negotiate"}; | 313 std::vector<std::string> supported_schemes = {"basic", "digest", "ntlm", |
| 314 "negotiate"}; |
| 314 http_auth_preferences_.reset(new net::HttpAuthPreferences(supported_schemes)); | 315 http_auth_preferences_.reset(new net::HttpAuthPreferences(supported_schemes)); |
| 315 | 316 |
| 316 UpdateServerWhitelist(); | 317 UpdateServerWhitelist(); |
| 317 UpdateAndroidAuthNegotiateAccountType(); | 318 UpdateAndroidAuthNegotiateAccountType(); |
| 318 | 319 |
| 319 return net::HttpAuthHandlerRegistryFactory::Create( | 320 return net::HttpAuthHandlerRegistryFactory::Create( |
| 320 http_auth_preferences_.get(), resolver); | 321 http_auth_preferences_.get(), resolver); |
| 321 } | 322 } |
| 322 | 323 |
| 323 void AwURLRequestContextGetter::UpdateServerWhitelist() { | 324 void AwURLRequestContextGetter::UpdateServerWhitelist() { |
| 324 http_auth_preferences_->set_server_whitelist( | 325 http_auth_preferences_->set_server_whitelist( |
| 325 auth_server_whitelist_.GetValue()); | 326 auth_server_whitelist_.GetValue()); |
| 326 } | 327 } |
| 327 | 328 |
| 328 void AwURLRequestContextGetter::UpdateAndroidAuthNegotiateAccountType() { | 329 void AwURLRequestContextGetter::UpdateAndroidAuthNegotiateAccountType() { |
| 329 http_auth_preferences_->set_auth_android_negotiate_account_type( | 330 http_auth_preferences_->set_auth_android_negotiate_account_type( |
| 330 auth_android_negotiate_account_type_.GetValue()); | 331 auth_android_negotiate_account_type_.GetValue()); |
| 331 } | 332 } |
| 332 | 333 |
| 333 } // namespace android_webview | 334 } // namespace android_webview |
| OLD | NEW |