Roll src/third_party/skia 4cf9e7e:8ee06f2
[chromium-blink-merge.git] / net / http / url_security_manager.cc
blob4ff0f654dacfbcb192e1f83cda0e38bf98c1acd1
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
3 // found in the LICENSE file.
5 #include "net/http/url_security_manager.h"
7 #include "net/http/http_auth_filter.h"
9 namespace net {
11 URLSecurityManagerWhitelist::URLSecurityManagerWhitelist(
12 const HttpAuthFilter* whitelist_default,
13 const HttpAuthFilter* whitelist_delegate)
14 : whitelist_default_(whitelist_default),
15 whitelist_delegate_(whitelist_delegate) {
18 URLSecurityManagerWhitelist::~URLSecurityManagerWhitelist() {}
20 bool URLSecurityManagerWhitelist::CanUseDefaultCredentials(
21 const GURL& auth_origin) const {
22 if (whitelist_default_.get())
23 return whitelist_default_->IsValid(auth_origin, HttpAuth::AUTH_SERVER);
24 return false;
27 bool URLSecurityManagerWhitelist::CanDelegate(const GURL& auth_origin) const {
28 if (whitelist_delegate_.get())
29 return whitelist_delegate_->IsValid(auth_origin, HttpAuth::AUTH_SERVER);
30 return false;
33 } // namespace net