electron/atom/browser/atom_browser_context.h

64 lines
2 KiB
C
Raw Normal View History

// Copyright (c) 2013 GitHub, Inc.
2014-04-25 09:49:37 +00:00
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_ATOM_BROWSER_CONTEXT_H_
#define ATOM_BROWSER_ATOM_BROWSER_CONTEXT_H_
2015-07-14 19:16:13 +00:00
#include <string>
#include "brightray/browser/browser_context.h"
namespace atom {
class AtomDownloadManagerDelegate;
class AtomCertVerifier;
class AtomURLRequestJobFactory;
2014-10-22 14:55:13 +00:00
class WebViewManager;
class AtomBrowserContext : public brightray::BrowserContext {
public:
AtomBrowserContext(const std::string& partition, bool in_memory);
~AtomBrowserContext() override;
// brightray::URLRequestContextGetter::Delegate:
std::string GetUserAgent() override;
2014-12-16 01:15:56 +00:00
net::URLRequestJobFactory* CreateURLRequestJobFactory(
content::ProtocolHandlerMap* handlers,
2014-10-22 14:55:13 +00:00
content::URLRequestInterceptorScopedVector* interceptors) override;
net::HttpCache::BackendFactory* CreateHttpCacheBackendFactory(
const base::FilePath& base_path) override;
net::CertVerifier* CreateCertVerifier() override;
net::SSLConfigService* CreateSSLConfigService() override;
bool AllowNTLMCredentialsForDomain(const GURL& auth_origin) override;
2014-10-22 14:55:13 +00:00
// content::BrowserContext:
content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
2014-12-16 01:15:56 +00:00
content::BrowserPluginGuestManager* GetGuestManager() override;
2015-07-27 01:09:32 +00:00
// brightray::BrowserContext:
void RegisterPrefs(PrefRegistrySimple* pref_registry) override;
2015-10-19 20:07:14 +00:00
void AllowNTLMCredentialsForAllDomains(bool should_allow);
AtomCertVerifier* cert_verifier() const { return cert_verifier_; }
2014-10-23 15:08:48 +00:00
AtomURLRequestJobFactory* job_factory() const { return job_factory_; }
private:
scoped_ptr<AtomDownloadManagerDelegate> download_manager_delegate_;
2014-10-22 14:55:13 +00:00
scoped_ptr<WebViewManager> guest_manager_;
// Managed by brightray::BrowserContext.
AtomCertVerifier* cert_verifier_;
AtomURLRequestJobFactory* job_factory_;
bool allow_ntlm_everywhere_;
DISALLOW_COPY_AND_ASSIGN(AtomBrowserContext);
};
} // namespace atom
#endif // ATOM_BROWSER_ATOM_BROWSER_CONTEXT_H_