| 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 #include "net/http/url_security_manager.h" | 5 #include "net/http/url_security_manager.h" |
| 6 | 6 |
| 7 #include "net/http/http_auth_filter.h" | 7 #include "net/http/http_auth_filter.h" |
| 8 | 8 |
| 9 namespace net { | 9 namespace net { |
| 10 | 10 |
| 11 URLSecurityManagerWhitelist::URLSecurityManagerWhitelist( | 11 URLSecurityManagerWhitelist::URLSecurityManagerWhitelist( |
| 12 HttpAuthFilter* whitelist) : whitelist_(whitelist) { | 12 const HttpAuthFilter* whitelist_default, |
| 13 const HttpAuthFilter* whitelist_delegate) |
| 14 : whitelist_default_(whitelist_default), |
| 15 whitelist_delegate_(whitelist_delegate) { |
| 13 } | 16 } |
| 14 | 17 |
| 15 bool URLSecurityManagerWhitelist::CanUseDefaultCredentials( | 18 bool URLSecurityManagerWhitelist::CanUseDefaultCredentials( |
| 16 const GURL& auth_origin) { | 19 const GURL& auth_origin) const { |
| 17 if (whitelist_.get()) | 20 if (whitelist_default_.get()) |
| 18 return whitelist_->IsValid(auth_origin, HttpAuth::AUTH_SERVER); | 21 return whitelist_default_->IsValid(auth_origin, HttpAuth::AUTH_SERVER); |
| 22 return false; |
| 23 } |
| 24 |
| 25 bool URLSecurityManagerWhitelist::CanDelegate(const GURL& auth_origin) const { |
| 26 if (whitelist_delegate_.get()) |
| 27 return whitelist_delegate_->IsValid(auth_origin, HttpAuth::AUTH_SERVER); |
| 19 return false; | 28 return false; |
| 20 } | 29 } |
| 21 | 30 |
| 22 } // namespace net | 31 } // namespace net |
| OLD | NEW |