electron/shell/browser/login_handler.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

55 lines
1.6 KiB
C
Raw Normal View History

2015-10-28 15:34:41 +08:00
// 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 ELECTRON_SHELL_BROWSER_LOGIN_HANDLER_H_
#define ELECTRON_SHELL_BROWSER_LOGIN_HANDLER_H_
2015-10-28 15:34:41 +08:00
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/login_delegate.h"
#include "content/public/browser/web_contents_observer.h"
2015-10-28 15:34:41 +08:00
namespace content {
class WebContents;
}
namespace gin {
class Arguments;
}
2015-10-28 15:34:41 +08:00
namespace electron {
// Handles HTTP basic auth.
class LoginHandler : public content::LoginDelegate,
refactor: inherit Observer classes privately, pt. 2 (#42237) * refactor: use private inheritance in PushNotifications * refactor: use private inheritance in electron::api::App * refactor: use private inheritance in electron::api::BrowserWindow * refactor: use private inheritance in electron::api::NativeTheme * refactor: use private inheritance in electron::api::Tray * refactor: use private inheritance in electron::api::Session * refactor: use private inheritance in electron::api::WebContents * refactor: use private inheritance in electron::api::DownloadItem * refactor: use private inheritance in electron::api::MenuBar * refactor: use private inheritance in ClearDataOperation * refactor: use private inheritance in electron::api::Screen * refactor: use private inheritance in electron::ElectronDesktopWindowTreeHostLinux * refactor: use private inheritance in SpellCheckerHolder * refactor: use private inheritance in electron::api::PowerMonitor * refactor: use private inheritance in electron::api::BaseWindow * refactor: use private inheritance in electron::api::AutoUpdater * refactor: use private inheritance in electron::api::Menu * refactor: use private inheritance in electron::api::NativeWindowViews * refactor: use private inheritance in electron::ElectronBrowserClient * refactor: use private inheritance in electron::AutofillPopupView * refactor: use private inheritance in GtkMessageBox * refactor: use private inheritance in electron::OffScreenRenderWidgetHostView * refactor: use private inheritance in electron::InspectableWebContents * refactor: use private inheritance in electron::ElectronUsbDelegate * refactor: use private inheritance in electron::LoginHandler * refactor: use private inheritance in WebFrameRenderer * refactor: use private inheritance in electron::ElectronSerialDelegate * refactor: use private inheritance in electron::ClientFrameViewLinux * refactor: use private inheritance in electron::ElectronHidDelegate * refactor: use private inheritance in IPCRenderer * refactor: use private inheritance in electron::WinCaptionButtonContainer * refactor: use private inheritance in electron::ElectronApiIPCHandlerImpl * refactor: use private inheritance in electron::api::ServiceWorkerContext * refactor: use private inheritance in ui::FileSelectHelper * refactor: use private inheritance in electron::api::WebContentsView * refactor: use private inheritance in electron::api::SimpleURLLoaderWrapper * refactor: use private inheritance in electron::api::InAppPurchase * refactor: use private inheritance in electron::api::Debugger * refactor: use private inheritance in electron::ElectronWebContentsUtilityHandlerImpl * refactor: use private inheritance in electron::OffScreenWebContentsView
2024-05-29 13:07:02 -05:00
private content::WebContentsObserver {
2015-10-28 15:34:41 +08:00
public:
LoginHandler(const net::AuthChallengeInfo& auth_info,
content::WebContents* web_contents,
bool is_main_frame,
const GURL& url,
scoped_refptr<net::HttpResponseHeaders> response_headers,
bool first_auth_attempt,
LoginAuthRequiredCallback auth_required_callback);
~LoginHandler() override;
2015-10-28 15:34:41 +08:00
// disable copy
LoginHandler(const LoginHandler&) = delete;
LoginHandler& operator=(const LoginHandler&) = delete;
2015-10-28 15:34:41 +08:00
private:
void EmitEvent(net::AuthChallengeInfo auth_info,
bool is_main_frame,
const GURL& url,
scoped_refptr<net::HttpResponseHeaders> response_headers,
bool first_auth_attempt);
void CallbackFromJS(gin::Arguments* args);
2015-10-28 15:34:41 +08:00
LoginAuthRequiredCallback auth_required_callback_;
base::WeakPtrFactory<LoginHandler> weak_factory_{this};
2015-10-28 15:34:41 +08:00
};
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_LOGIN_HANDLER_H_