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