chrome: Add CefJSDialogHandler support (fixes #3702)

This commit is contained in:
Yuta Sekiguchi
2024-06-04 12:19:14 -04:00
committed by Marshall Greenblatt
parent fd7444c7a4
commit e4bb51f6f6
8 changed files with 58 additions and 24 deletions

View File

@@ -20,6 +20,7 @@
#include "cef/libcef/browser/devtools/devtools_window_runner.h"
#include "cef/libcef/browser/file_dialog_manager.h"
#include "cef/libcef/browser/frame_host_impl.h"
#include "cef/libcef/browser/javascript_dialog_manager.h"
#include "cef/libcef/browser/media_stream_registrar.h"
#include "cef/libcef/browser/request_context_impl.h"
#include "cef/libcef/features/features.h"
@@ -357,6 +358,10 @@ class CefBrowserHostBase : public CefBrowserHost,
void* params);
void SelectFileListenerDestroyed(ui::SelectFileDialog::Listener* listener);
// Called from AlloyBrowserHostImpl::GetJavaScriptDialogManager and
// ChromeBrowserDelegate::GetJavaScriptDialogManager.
content::JavaScriptDialogManager* GetJavaScriptDialogManager();
// Called from CefBrowserInfoManager::MaybeAllowNavigation.
virtual bool MaybeAllowNavigation(content::RenderFrameHost* opener,
const content::OpenURLParams& params);
@@ -471,6 +476,9 @@ class CefBrowserHostBase : public CefBrowserHost,
// Used for creating and managing file dialogs.
std::unique_ptr<CefFileDialogManager> file_dialog_manager_;
// Used for creating and managing JavaScript dialogs.
std::unique_ptr<CefJavaScriptDialogManager> javascript_dialog_manager_;
// Volatile state accessed from multiple threads. All access must be protected
// by |state_lock_|.
base::Lock state_lock_;