#include "atom/browser/atom_resource_dispatcher_host_delegate.h"
+#include "atom/browser/login_handler.h"
#include "atom/common/platform_util.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/escape.h"
return true;
}
+content::ResourceDispatcherHostLoginDelegate*
+AtomResourceDispatcherHostDelegate::CreateLoginDelegate(
+ net::AuthChallengeInfo* auth_info,
+ net::URLRequest* request) {
+ return new LoginHandler(auth_info, request);
+}
+
} // namespace atom
bool is_main_frame,
ui::PageTransition transition,
bool has_user_gesture) override;
+ content::ResourceDispatcherHostLoginDelegate* CreateLoginDelegate(
+ net::AuthChallengeInfo* auth_info,
+ net::URLRequest* request) override;
};
} // namespace atom
--- /dev/null
+// Copyright (c) 2015 GitHub, Inc.
+// Use of this source code is governed by the MIT license that can be
+// found in the LICENSE file.
+
+#include "atom/browser/login_handler.h"
+
+#include "net/base/auth.h"
+
+namespace atom {
+
+LoginHandler::LoginHandler(net::AuthChallengeInfo* auth_info,
+ net::URLRequest* request)
+ : auth_info_(auth_info), request_(request), weak_factory_(this) {
+}
+
+LoginHandler::~LoginHandler() {
+}
+
+void LoginHandler::OnRequestCancelled() {
+}
+
+} // namespace atom
--- /dev/null
+// Copyright (c) 2015 GitHub, Inc.
+// Use of this source code is governed by the MIT license that can be
+// found in the LICENSE file.
+
+#ifndef ATOM_BROWSER_LOGIN_HANDLER_H_
+#define ATOM_BROWSER_LOGIN_HANDLER_H_
+
+#include "base/memory/weak_ptr.h"
+#include "content/public/browser/resource_dispatcher_host_login_delegate.h"
+
+namespace net {
+class AuthChallengeInfo;
+class URLRequest;
+}
+
+namespace atom {
+
+class LoginHandler : public content::ResourceDispatcherHostLoginDelegate {
+ public:
+ LoginHandler(net::AuthChallengeInfo* auth_info, net::URLRequest* request);
+
+ protected:
+ ~LoginHandler() override;
+
+ // content::ResourceDispatcherHostLoginDelegate:
+ void OnRequestCancelled() override;
+
+ private:
+ // Who/where/what asked for the authentication.
+ scoped_refptr<net::AuthChallengeInfo> auth_info_;
+
+ // The request that wants login data.
+ // This should only be accessed on the IO loop.
+ net::URLRequest* request_;
+
+ base::WeakPtrFactory<LoginHandler> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(LoginHandler);
+};
+
+} // namespace atom
+
+#endif // ATOM_BROWSER_LOGIN_HANDLER_H_
'atom/browser/common_web_contents_delegate.h',
'atom/browser/javascript_environment.cc',
'atom/browser/javascript_environment.h',
+ 'atom/browser/login_handler.cc',
+ 'atom/browser/login_handler.h',
'atom/browser/mac/atom_application.h',
'atom/browser/mac/atom_application.mm',
'atom/browser/mac/atom_application_delegate.h',