diff options
author | ahendrickson@chromium.org <ahendrickson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-02 17:27:10 +0000 |
---|---|---|
committer | ahendrickson@chromium.org <ahendrickson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-02 17:27:10 +0000 |
commit | 930cbb5855c54aedb590bc522963320c189a3e52 (patch) | |
tree | 3d579aa9a2c65210b2c3453e32a0d2991d4bf2f9 /net/http/url_security_manager_posix.cc | |
parent | e457f74143dcabf0663983cb376425f121a0dc84 (diff) | |
download | chromium_src-930cbb5855c54aedb590bc522963320c189a3e52.zip chromium_src-930cbb5855c54aedb590bc522963320c189a3e52.tar.gz chromium_src-930cbb5855c54aedb590bc522963320c189a3e52.tar.bz2 |
Added command-line whitelist data to UrlSecurityManager. These are used by all platforms; Windows will use IInternetSecurityManager if they are not present.
Removed registry code from HttpAuthFilterWhitelist, as we're now using a different method of authentication on Windows.
BUG=29596
TEST=None.
Review URL: http://codereview.chromium.org/1569010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43493 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/url_security_manager_posix.cc')
-rw-r--r-- | net/http/url_security_manager_posix.cc | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/net/http/url_security_manager_posix.cc b/net/http/url_security_manager_posix.cc index 84bae9f..5a52576 100644 --- a/net/http/url_security_manager_posix.cc +++ b/net/http/url_security_manager_posix.cc @@ -2,24 +2,34 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "net/http/http_auth.h" +#include "net/http/http_auth_filter.h" #include "net/http/url_security_manager.h" #include "googleurl/src/gurl.h" namespace net { -class URLSecurityManagerDefault : public URLSecurityManager { +class URLSecurityManagerPosix : public URLSecurityManager { public: + explicit URLSecurityManagerPosix(const HttpAuthFilter* whitelist) + : URLSecurityManager(whitelist) {} + // URLSecurityManager methods: - virtual bool CanUseDefaultCredentials(const GURL& auth_origin) const { - // TODO(wtc): use command-line whitelist. - return false; - } + virtual bool CanUseDefaultCredentials(const GURL& auth_origin) const; }; +bool URLSecurityManagerPosix::CanUseDefaultCredentials( + const GURL& auth_origin) const { + if (whitelist_) + return whitelist_->IsValid(auth_origin, HttpAuth::AUTH_SERVER); + return false; +} + // static -URLSecurityManager* URLSecurityManager::Create() { - return new URLSecurityManagerDefault; +URLSecurityManager* URLSecurityManager::Create( + const HttpAuthFilter* whitelist) { + return new URLSecurityManagerPosix(whitelist); } } // namespace net |