electron/shell/browser/login_handler.h

59 lines
1.8 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 "base/process/process_handle.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/login_delegate.h"
2015-10-28 15:34:41 +08:00
namespace content {
class WebContents;
}
namespace gin {
class Arguments;
}
namespace electron {
2015-10-28 15:34:41 +08:00
// Handles HTTP basic auth.
class LoginHandler : public content::LoginDelegate {
2015-10-28 15:34:41 +08:00
public:
LoginHandler(const net::AuthChallengeInfo& auth_info,
content::WebContents* web_contents,
chore: bump chromium to 131.0.6762.0 (main) (#44117) * chore: bump chromium in DEPS to 131.0.6756.0 * chore: update disable_hidden.patch no code changes; just handling upstream context shear https://chromium-review.googlesource.com/c/chromium/src/+/5887019 * chore: update feat_expose_raw_response_headers_from_urlloader.patch Factor out URLLoader's URLRequest configuration into a helper Xref: https://chromium-review.googlesource.com/c/chromium/src/+/5902254 * chore: update fix_disabling_background_throttling_in_compositor.patch no manual changes; patch applied with fuzz 1 * chore: e patches all * 5882129: Fix basic auth issues for sub frame and sub resources | https://chromium-review.googlesource.com/c/chromium/src/+/5882129 - Add `is_request_for_navigation` param to ElectronBrowserClient::CreateLoginDelegate(). - Propagate the flag as another undocumented property in the app.login Event's authenticationResponseDetails object - Side cleanup: also in CreateLoginDelegate(), use upstream's name for the `is_request_for_main_frame` param, renamed back in https://chromium-review.googlesource.com/c/chromium/src/+/3256171 * 5875189: [FSA] Check for DANGEROUS extension types when creating a new file. | https://chromium-review.googlesource.com/c/chromium/src/+/5875189 * chore: node ./script/gen-libc++-filenames.js * chore: bump chromium in DEPS to 131.0.6758.0 * chore: bump chromium in DEPS to 131.0.6760.0 * chore: update patches * [A11y] Remove Accessibility Object Model (AOM) Refs https://chromium-review.googlesource.com/c/chromium/src/+/5896593 * chore: bump chromium in DEPS to 131.0.6762.0 * [heap] Remove deprecated V8 flag Refs https://chromium-review.googlesource.com/c/v8/v8/+/5904046 --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com> Co-authored-by: deepak1556 <hop2deep@gmail.com>
2024-10-07 18:06:47 -05:00
bool is_request_for_primary_main_frame,
bool is_request_for_navigation,
base::ProcessId process_id,
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,
content::WebContents* web_contents,
chore: bump chromium to 131.0.6762.0 (main) (#44117) * chore: bump chromium in DEPS to 131.0.6756.0 * chore: update disable_hidden.patch no code changes; just handling upstream context shear https://chromium-review.googlesource.com/c/chromium/src/+/5887019 * chore: update feat_expose_raw_response_headers_from_urlloader.patch Factor out URLLoader's URLRequest configuration into a helper Xref: https://chromium-review.googlesource.com/c/chromium/src/+/5902254 * chore: update fix_disabling_background_throttling_in_compositor.patch no manual changes; patch applied with fuzz 1 * chore: e patches all * 5882129: Fix basic auth issues for sub frame and sub resources | https://chromium-review.googlesource.com/c/chromium/src/+/5882129 - Add `is_request_for_navigation` param to ElectronBrowserClient::CreateLoginDelegate(). - Propagate the flag as another undocumented property in the app.login Event's authenticationResponseDetails object - Side cleanup: also in CreateLoginDelegate(), use upstream's name for the `is_request_for_main_frame` param, renamed back in https://chromium-review.googlesource.com/c/chromium/src/+/3256171 * 5875189: [FSA] Check for DANGEROUS extension types when creating a new file. | https://chromium-review.googlesource.com/c/chromium/src/+/5875189 * chore: node ./script/gen-libc++-filenames.js * chore: bump chromium in DEPS to 131.0.6758.0 * chore: bump chromium in DEPS to 131.0.6760.0 * chore: update patches * [A11y] Remove Accessibility Object Model (AOM) Refs https://chromium-review.googlesource.com/c/chromium/src/+/5896593 * chore: bump chromium in DEPS to 131.0.6762.0 * [heap] Remove deprecated V8 flag Refs https://chromium-review.googlesource.com/c/v8/v8/+/5904046 --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com> Co-authored-by: deepak1556 <hop2deep@gmail.com>
2024-10-07 18:06:47 -05:00
bool is_request_for_primary_main_frame,
bool is_request_for_navigation,
base::ProcessId process_id,
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
2015-10-28 15:34:41 +08:00
#endif // ELECTRON_SHELL_BROWSER_LOGIN_HANDLER_H_