| Index: net/http/http_auth_preferences.h
|
| diff --git a/net/http/http_auth_preferences.h b/net/http/http_auth_preferences.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..1a58041bb104faf01426dc8a722c83c4d0c6ae1d
|
| --- /dev/null
|
| +++ b/net/http/http_auth_preferences.h
|
| @@ -0,0 +1,71 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef NET_HTTP_HTTP_AUTH_PREFERENCES_H_
|
| +#define NET_HTTP_HTTP_AUTH_PREFERENCES_H_
|
| +
|
| +#include <string>
|
| +#include <vector>
|
| +#include "base/macros.h"
|
| +#include "base/prefs/pref_member.h"
|
| +#include "base/prefs/pref_registry_simple.h"
|
| +#include "net/base/net_export.h"
|
| +#include "url/gurl.h"
|
| +
|
| +namespace net {
|
| +
|
| +class URLSecurityManager;
|
| +/*
|
| + * Manage the preferences needed for authentication, and provide a cache of them
|
| + * accessible from the IO thread.
|
| + */
|
| +class NET_EXPORT HttpAuthPreferences {
|
| + public:
|
| + HttpAuthPreferences();
|
| + virtual ~HttpAuthPreferences();
|
| +
|
| + static void RegisterPrefs(PrefRegistrySimple* registry);
|
| +
|
| + void Init(PrefService* local_state,
|
| + scoped_refptr<base::SingleThreadTaskRunner> task_runner);
|
| +
|
| + virtual std::vector<std::string> auth_schemes() const;
|
| + virtual bool negotiate_disable_cname_lookup() const;
|
| + virtual bool negotiate_enable_port() const;
|
| +#if defined(OS_ANDROID)
|
| + virtual std::string auth_android_negotiate_account_type() const;
|
| +#endif
|
| +#if defined(OS_POSIX) && !defined(OS_ANDROID)
|
| + virtual std::string gssapi_library_name() const;
|
| +#endif
|
| + virtual bool CanUseDefaultCredentials(const GURL& auth_origin) const;
|
| + virtual bool CanDelegate(const GURL& auth_origin) const;
|
| +
|
| + private:
|
| + void UpdateServerWhitelist();
|
| + void UpdateDelegateWhitelist();
|
| +
|
| + // TODO(aberent) Make the list of auth schemes a PrefMember, so that the
|
| + // policy can change after startup (https://crbug/549273).
|
| + std::vector<std::string> auth_schemes_;
|
| + BooleanPrefMember negotiate_disable_cname_lookup_;
|
| + BooleanPrefMember negotiate_enable_port_;
|
| +
|
| + StringPrefMember server_whitelist_;
|
| + StringPrefMember delegate_whitelist_;
|
| +#if defined(OS_ANDROID)
|
| + StringPrefMember auth_android_negotiate_account_type_;
|
| +#endif
|
| +#if defined(OS_POSIX) && !defined(OS_ANDROID)
|
| + // No PrefMember for the GSSAPI library name, since changing it after startup
|
| + // requires unloading the existing GSSAPI library, which could cause all sorts
|
| + // of problems for, for example, active Negotiate transactions.
|
| + std::string gssapi_library_name_;
|
| +#endif
|
| + scoped_ptr<URLSecurityManager> security_manager_;
|
| + DISALLOW_COPY_AND_ASSIGN(HttpAuthPreferences);
|
| +};
|
| +}
|
| +// namespace net
|
| +#endif // NET_HTTP_HTTP_AUTH_PREFERENCES_H_
|
|
|