]> khamidou — GitHub mirrors - electron.git/commitdiff
Set up our browser context to use new delegate-based API
authorPaul Betts <paul@paulbetts.org>
Mon, 19 Oct 2015 20:03:20 +0000 (13:03 -0700)
committerPaul Betts <paul@paulbetts.org>
Mon, 19 Oct 2015 20:03:20 +0000 (13:03 -0700)
atom/browser/atom_browser_context.cc
atom/browser/atom_browser_context.h

index 6823fbaee90cbb5f5ee8c02aeb6a016fabfe07dc..13be18ce9bd6dcd79ea60fa2dd45dfb48614fd4d 100644 (file)
@@ -60,8 +60,8 @@ std::string RemoveWhitespace(const std::string& str) {
 AtomBrowserContext::AtomBrowserContext(const std::string& partition,
                                        bool in_memory)
     : brightray::BrowserContext(partition, in_memory),
-      job_factory_(new AtomURLRequestJobFactory) {
-}
+      job_factory_(new AtomURLRequestJobFactory),
+      allow_ntlm_everywhere_(false) : { }
 
 AtomBrowserContext::~AtomBrowserContext() {
 }
@@ -168,6 +168,12 @@ void AtomBrowserContext::RegisterPrefs(PrefRegistrySimple* pref_registry) {
                                       base::FilePath());
 }
 
+
+bool AtomBrowserContext::AllowNTLMCredentialsForDomain(const GURL& auth_origin) {
+  if (allow_ntlm_everywhere_) return true;
+  return brightray::URLRequestContextGetter::Delegate::AllowNTLMCredentialsForDomain(auth_origin);
+}
+
 }  // namespace atom
 
 namespace brightray {
index 839359c1ef50e219cd086724b13eecc5865a7c6f..9ec3928272b3e23e9364065d7ed2bbe3482a5bb0 100644 (file)
@@ -28,6 +28,7 @@ class AtomBrowserContext : public brightray::BrowserContext {
   net::HttpCache::BackendFactory* CreateHttpCacheBackendFactory(
       const base::FilePath& base_path) override;
   net::SSLConfigService* CreateSSLConfigService() override;
+  bool AllowNTLMCredentialsForDomain(const GURL& auth_origin) override;
 
   // content::BrowserContext:
   content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
@@ -44,6 +45,8 @@ class AtomBrowserContext : public brightray::BrowserContext {
 
   // Managed by brightray::BrowserContext.
   AtomURLRequestJobFactory* job_factory_;
+  
+  bool allow_ntlm_everywhere_;
 
   DISALLOW_COPY_AND_ASSIGN(AtomBrowserContext);
 };