2015-11-17 19:20:13 +01:00
|
|
|
// Copyright 2015 The Chromium Embedded Framework Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#include "libcef/browser/browser_platform_delegate.h"
|
|
|
|
|
2020-09-22 21:54:02 +02:00
|
|
|
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
|
2023-06-26 12:08:04 +02:00
|
|
|
#include "libcef/browser/thread_util.h"
|
2015-11-17 19:20:13 +01:00
|
|
|
|
|
|
|
#include "base/logging.h"
|
2023-06-26 12:08:04 +02:00
|
|
|
#include "chrome/browser/platform_util.h"
|
|
|
|
#include "chrome/browser/shell_integration.h"
|
2022-04-11 23:29:53 +02:00
|
|
|
#include "content/public/browser/render_view_host.h"
|
|
|
|
#include "content/public/browser/render_widget_host.h"
|
|
|
|
#include "content/public/browser/render_widget_host_view.h"
|
2020-07-04 20:21:34 +02:00
|
|
|
|
2023-06-26 12:08:04 +02:00
|
|
|
namespace {
|
|
|
|
|
|
|
|
void ExecuteExternalProtocol(const GURL& url) {
|
|
|
|
CEF_REQUIRE_BLOCKING();
|
|
|
|
|
|
|
|
// Check that an application is associated with the scheme.
|
|
|
|
if (shell_integration::GetApplicationNameForScheme(url).empty()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
CEF_POST_TASK(TID_UI, base::BindOnce(&platform_util::OpenExternal, url));
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
2020-07-04 20:21:34 +02:00
|
|
|
CefBrowserPlatformDelegate::CefBrowserPlatformDelegate() = default;
|
2015-11-17 19:20:13 +01:00
|
|
|
|
|
|
|
CefBrowserPlatformDelegate::~CefBrowserPlatformDelegate() {
|
|
|
|
DCHECK(!browser_);
|
|
|
|
}
|
|
|
|
|
2020-09-25 03:40:47 +02:00
|
|
|
content::WebContents* CefBrowserPlatformDelegate::CreateWebContents(
|
|
|
|
CefBrowserCreateParams& create_params,
|
|
|
|
bool& own_web_contents) {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2020-09-25 03:40:47 +02:00
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2015-11-17 19:20:13 +01:00
|
|
|
void CefBrowserPlatformDelegate::CreateViewForWebContents(
|
|
|
|
content::WebContentsView** view,
|
|
|
|
content::RenderViewHostDelegateView** delegate_view) {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2015-11-17 19:20:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserPlatformDelegate::WebContentsCreated(
|
2020-07-03 22:13:27 +02:00
|
|
|
content::WebContents* web_contents,
|
|
|
|
bool owned) {
|
|
|
|
// We should not have a browser at this point.
|
|
|
|
DCHECK(!browser_);
|
|
|
|
|
|
|
|
DCHECK(!web_contents_);
|
|
|
|
web_contents_ = web_contents;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserPlatformDelegate::AddNewContents(
|
|
|
|
content::WebContents* source,
|
|
|
|
std::unique_ptr<content::WebContents> new_contents,
|
|
|
|
const GURL& target_url,
|
|
|
|
WindowOpenDisposition disposition,
|
2022-09-26 21:30:45 +02:00
|
|
|
const blink::mojom::WindowFeatures& window_features,
|
2020-07-03 22:13:27 +02:00
|
|
|
bool user_gesture,
|
|
|
|
bool* was_blocked) {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2020-07-03 22:13:27 +02:00
|
|
|
}
|
|
|
|
|
2020-07-04 04:51:17 +02:00
|
|
|
void CefBrowserPlatformDelegate::WebContentsDestroyed(
|
|
|
|
content::WebContents* web_contents) {
|
|
|
|
DCHECK(web_contents_ && web_contents_ == web_contents);
|
|
|
|
web_contents_ = nullptr;
|
|
|
|
}
|
|
|
|
|
2021-07-23 18:40:13 +02:00
|
|
|
bool CefBrowserPlatformDelegate::
|
|
|
|
ShouldAllowRendererInitiatedCrossProcessNavigation(
|
|
|
|
bool is_main_frame_navigation) {
|
2020-07-03 22:13:27 +02:00
|
|
|
return true;
|
|
|
|
}
|
2015-11-17 19:20:13 +01:00
|
|
|
|
|
|
|
void CefBrowserPlatformDelegate::RenderViewCreated(
|
2022-04-11 23:29:53 +02:00
|
|
|
content::RenderViewHost* render_view_host) {
|
|
|
|
// Indicate that the view has an external parent (namely us). This setting is
|
|
|
|
// required for proper focus handling on Windows and Linux.
|
2023-01-02 23:59:03 +01:00
|
|
|
if (HasExternalParent() && render_view_host->GetWidget()->GetView()) {
|
2022-04-11 23:29:53 +02:00
|
|
|
render_view_host->GetWidget()->GetView()->SetHasExternalParent(true);
|
2023-01-02 23:59:03 +01:00
|
|
|
}
|
2022-04-11 23:29:53 +02:00
|
|
|
}
|
2020-07-04 20:21:34 +02:00
|
|
|
|
|
|
|
void CefBrowserPlatformDelegate::RenderViewReady() {}
|
2015-11-17 19:20:13 +01:00
|
|
|
|
2020-09-25 03:40:47 +02:00
|
|
|
void CefBrowserPlatformDelegate::BrowserCreated(CefBrowserHostBase* browser) {
|
2020-07-03 22:13:27 +02:00
|
|
|
// We should have an associated WebContents at this point.
|
|
|
|
DCHECK(web_contents_);
|
|
|
|
|
2015-11-17 19:20:13 +01:00
|
|
|
DCHECK(!browser_);
|
2019-07-17 20:47:27 +02:00
|
|
|
DCHECK(browser);
|
2015-11-17 19:20:13 +01:00
|
|
|
browser_ = browser;
|
2020-07-03 22:13:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserPlatformDelegate::CreateExtensionHost(
|
|
|
|
const extensions::Extension* extension,
|
|
|
|
const GURL& url,
|
2021-04-21 00:52:34 +02:00
|
|
|
extensions::mojom::ViewType host_type) {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2020-07-04 20:21:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
extensions::ExtensionHost* CefBrowserPlatformDelegate::GetExtensionHost()
|
|
|
|
const {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2020-07-04 20:21:34 +02:00
|
|
|
return nullptr;
|
2015-11-17 19:20:13 +01:00
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
void CefBrowserPlatformDelegate::NotifyBrowserCreated() {}
|
2016-01-19 21:09:01 +01:00
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
void CefBrowserPlatformDelegate::NotifyBrowserDestroyed() {}
|
2016-01-19 21:09:01 +01:00
|
|
|
|
2020-09-25 03:40:47 +02:00
|
|
|
void CefBrowserPlatformDelegate::BrowserDestroyed(CefBrowserHostBase* browser) {
|
2020-07-04 04:51:17 +02:00
|
|
|
// WebContentsDestroyed should already be called.
|
|
|
|
DCHECK(!web_contents_);
|
|
|
|
|
2015-11-17 19:20:13 +01:00
|
|
|
DCHECK(browser_ && browser_ == browser);
|
|
|
|
browser_ = nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CefBrowserPlatformDelegate::CreateHostWindow() {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2015-11-17 19:20:13 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserPlatformDelegate::CloseHostWindow() {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2015-11-17 19:20:13 +01:00
|
|
|
}
|
|
|
|
|
2020-09-25 03:40:47 +02:00
|
|
|
CefWindowHandle CefBrowserPlatformDelegate::GetHostWindowHandle() const {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2020-09-25 03:40:47 +02:00
|
|
|
return kNullWindowHandle;
|
|
|
|
}
|
|
|
|
|
2015-11-17 19:20:13 +01:00
|
|
|
views::Widget* CefBrowserPlatformDelegate::GetWindowWidget() const {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2015-11-17 19:20:13 +01:00
|
|
|
return nullptr;
|
|
|
|
}
|
2016-01-19 21:09:01 +01:00
|
|
|
|
|
|
|
CefRefPtr<CefBrowserView> CefBrowserPlatformDelegate::GetBrowserView() const {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2016-01-19 21:09:01 +01:00
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2022-06-02 11:49:50 +02:00
|
|
|
web_modal::WebContentsModalDialogHost*
|
|
|
|
CefBrowserPlatformDelegate::GetWebContentsModalDialogHost() const {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2022-06-02 11:49:50 +02:00
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2016-01-19 21:09:01 +01:00
|
|
|
void CefBrowserPlatformDelegate::PopupWebContentsCreated(
|
|
|
|
const CefBrowserSettings& settings,
|
|
|
|
CefRefPtr<CefClient> client,
|
|
|
|
content::WebContents* new_web_contents,
|
|
|
|
CefBrowserPlatformDelegate* new_platform_delegate,
|
2017-05-17 11:29:28 +02:00
|
|
|
bool is_devtools) {}
|
2016-01-19 21:09:01 +01:00
|
|
|
|
|
|
|
void CefBrowserPlatformDelegate::PopupBrowserCreated(
|
2020-09-25 03:40:47 +02:00
|
|
|
CefBrowserHostBase* new_browser,
|
2017-05-17 11:29:28 +02:00
|
|
|
bool is_devtools) {}
|
2015-11-17 19:20:13 +01:00
|
|
|
|
2020-09-25 03:40:47 +02:00
|
|
|
SkColor CefBrowserPlatformDelegate::GetBackgroundColor() const {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2020-09-25 03:40:47 +02:00
|
|
|
return SkColor();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserPlatformDelegate::WasResized() {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2020-09-25 03:40:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserPlatformDelegate::SendKeyEvent(const CefKeyEvent& event) {
|
|
|
|
NOTIMPLEMENTED();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserPlatformDelegate::SendMouseClickEvent(
|
|
|
|
const CefMouseEvent& event,
|
|
|
|
CefBrowserHost::MouseButtonType type,
|
|
|
|
bool mouseUp,
|
|
|
|
int clickCount) {
|
|
|
|
NOTIMPLEMENTED();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserPlatformDelegate::SendMouseMoveEvent(const CefMouseEvent& event,
|
|
|
|
bool mouseLeave) {
|
|
|
|
NOTIMPLEMENTED();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserPlatformDelegate::SendMouseWheelEvent(const CefMouseEvent& event,
|
|
|
|
int deltaX,
|
|
|
|
int deltaY) {
|
|
|
|
NOTIMPLEMENTED();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserPlatformDelegate::SendTouchEvent(const CefTouchEvent& event) {
|
|
|
|
NOTIMPLEMENTED();
|
|
|
|
}
|
|
|
|
|
2022-04-08 22:48:56 +02:00
|
|
|
void CefBrowserPlatformDelegate::SetFocus(bool setFocus) {}
|
2020-09-25 03:40:47 +02:00
|
|
|
|
2015-11-17 19:20:13 +01:00
|
|
|
void CefBrowserPlatformDelegate::SendCaptureLostEvent() {
|
2020-07-04 20:21:34 +02:00
|
|
|
NOTIMPLEMENTED();
|
2015-11-17 19:20:13 +01:00
|
|
|
}
|
|
|
|
|
2022-01-24 18:58:02 +01:00
|
|
|
#if BUILDFLAG(IS_WIN) || (BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC))
|
2020-07-04 20:21:34 +02:00
|
|
|
void CefBrowserPlatformDelegate::NotifyMoveOrResizeStarted() {}
|
2015-11-17 19:20:13 +01:00
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
void CefBrowserPlatformDelegate::SizeTo(int width, int height) {}
|
2015-11-17 19:20:13 +01:00
|
|
|
#endif
|
|
|
|
|
2020-09-25 03:40:47 +02:00
|
|
|
gfx::Point CefBrowserPlatformDelegate::GetScreenPoint(
|
2022-05-13 13:38:41 +02:00
|
|
|
const gfx::Point& view,
|
|
|
|
bool want_dip_coords) const {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2020-09-25 03:40:47 +02:00
|
|
|
return gfx::Point();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserPlatformDelegate::ViewText(const std::string& text) {
|
|
|
|
NOTIMPLEMENTED();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CefBrowserPlatformDelegate::HandleKeyboardEvent(
|
|
|
|
const content::NativeWebKeyboardEvent& event) {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2020-09-25 03:40:47 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-07-03 22:13:27 +02:00
|
|
|
bool CefBrowserPlatformDelegate::PreHandleGestureEvent(
|
|
|
|
content::WebContents* source,
|
|
|
|
const blink::WebGestureEvent& event) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CefBrowserPlatformDelegate::IsNeverComposited(
|
|
|
|
content::WebContents* web_contents) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2023-06-26 12:08:04 +02:00
|
|
|
// static
|
|
|
|
void CefBrowserPlatformDelegate::HandleExternalProtocol(const GURL& url) {
|
|
|
|
CEF_POST_USER_VISIBLE_TASK(base::BindOnce(ExecuteExternalProtocol, url));
|
|
|
|
}
|
|
|
|
|
2020-09-25 03:40:47 +02:00
|
|
|
CefEventHandle CefBrowserPlatformDelegate::GetEventHandle(
|
|
|
|
const content::NativeWebKeyboardEvent& event) const {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2020-09-25 03:40:47 +02:00
|
|
|
return kNullEventHandle;
|
|
|
|
}
|
|
|
|
|
2016-04-27 22:38:52 +02:00
|
|
|
std::unique_ptr<CefJavaScriptDialogRunner>
|
2017-05-17 11:29:28 +02:00
|
|
|
CefBrowserPlatformDelegate::CreateJavaScriptDialogRunner() {
|
2015-11-17 19:20:13 +01:00
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2020-09-25 03:40:47 +02:00
|
|
|
std::unique_ptr<CefMenuRunner> CefBrowserPlatformDelegate::CreateMenuRunner() {
|
|
|
|
NOTIMPLEMENTED();
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2023-04-12 20:34:39 +02:00
|
|
|
void CefBrowserPlatformDelegate::UpdateFindBarBoundingBox(
|
|
|
|
gfx::Rect* bounds) const {}
|
|
|
|
|
2020-09-25 03:40:47 +02:00
|
|
|
bool CefBrowserPlatformDelegate::IsWindowless() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CefBrowserPlatformDelegate::IsViewsHosted() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2022-04-11 23:29:53 +02:00
|
|
|
bool CefBrowserPlatformDelegate::HasExternalParent() const {
|
|
|
|
// In the majority of cases a Views-hosted browser will not have an external
|
|
|
|
// parent, and visa-versa.
|
|
|
|
return !IsViewsHosted();
|
|
|
|
}
|
|
|
|
|
2015-11-17 19:20:13 +01:00
|
|
|
void CefBrowserPlatformDelegate::WasHidden(bool hidden) {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2015-11-17 19:20:13 +01:00
|
|
|
}
|
|
|
|
|
2022-06-02 11:49:50 +02:00
|
|
|
bool CefBrowserPlatformDelegate::IsHidden() const {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2022-06-02 11:49:50 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-11-17 19:20:13 +01:00
|
|
|
void CefBrowserPlatformDelegate::NotifyScreenInfoChanged() {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2015-11-17 19:20:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserPlatformDelegate::Invalidate(cef_paint_element_type_t type) {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2015-11-17 19:20:13 +01:00
|
|
|
}
|
|
|
|
|
2018-07-03 02:46:03 +02:00
|
|
|
void CefBrowserPlatformDelegate::SendExternalBeginFrame() {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2018-07-03 02:46:03 +02:00
|
|
|
}
|
|
|
|
|
2015-11-17 19:20:13 +01:00
|
|
|
void CefBrowserPlatformDelegate::SetWindowlessFrameRate(int frame_rate) {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2015-11-17 19:20:13 +01:00
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
void CefBrowserPlatformDelegate::ImeSetComposition(
|
|
|
|
const CefString& text,
|
2016-10-28 18:11:24 +02:00
|
|
|
const std::vector<CefCompositionUnderline>& underlines,
|
|
|
|
const CefRange& replacement_range,
|
|
|
|
const CefRange& selection_range) {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2015-11-17 19:20:13 +01:00
|
|
|
}
|
|
|
|
|
2016-10-28 18:11:24 +02:00
|
|
|
void CefBrowserPlatformDelegate::ImeCommitText(
|
|
|
|
const CefString& text,
|
|
|
|
const CefRange& replacement_range,
|
|
|
|
int relative_cursor_pos) {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2015-11-17 19:20:13 +01:00
|
|
|
}
|
|
|
|
|
2016-10-28 18:11:24 +02:00
|
|
|
void CefBrowserPlatformDelegate::ImeFinishComposingText(bool keep_selection) {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2016-10-28 18:11:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserPlatformDelegate::ImeCancelComposition() {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2015-11-17 19:20:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserPlatformDelegate::DragTargetDragEnter(
|
|
|
|
CefRefPtr<CefDragData> drag_data,
|
|
|
|
const CefMouseEvent& event,
|
|
|
|
cef_drag_operations_mask_t allowed_ops) {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2015-11-17 19:20:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserPlatformDelegate::DragTargetDragOver(
|
|
|
|
const CefMouseEvent& event,
|
|
|
|
cef_drag_operations_mask_t allowed_ops) {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2015-11-17 19:20:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserPlatformDelegate::DragTargetDragLeave() {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2015-11-17 19:20:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserPlatformDelegate::DragTargetDrop(const CefMouseEvent& event) {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2015-11-17 19:20:13 +01:00
|
|
|
}
|
|
|
|
|
2016-11-23 21:54:29 +01:00
|
|
|
void CefBrowserPlatformDelegate::StartDragging(
|
|
|
|
const content::DropData& drop_data,
|
2020-10-08 21:54:42 +02:00
|
|
|
blink::DragOperationsMask allowed_ops,
|
2016-11-23 21:54:29 +01:00
|
|
|
const gfx::ImageSkia& image,
|
|
|
|
const gfx::Vector2d& image_offset,
|
2020-10-08 21:54:42 +02:00
|
|
|
const blink::mojom::DragEventSourceInfo& event_info,
|
2016-11-23 21:54:29 +01:00
|
|
|
content::RenderWidgetHostImpl* source_rwh) {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2016-11-23 21:54:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserPlatformDelegate::UpdateDragCursor(
|
2021-01-28 00:13:12 +01:00
|
|
|
ui::mojom::DragOperation operation) {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2016-11-23 21:54:29 +01:00
|
|
|
}
|
|
|
|
|
2015-11-17 19:20:13 +01:00
|
|
|
void CefBrowserPlatformDelegate::DragSourceEndedAt(
|
2017-05-17 11:29:28 +02:00
|
|
|
int x,
|
|
|
|
int y,
|
2015-11-17 19:20:13 +01:00
|
|
|
cef_drag_operations_mask_t op) {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2015-11-17 19:20:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserPlatformDelegate::DragSourceSystemDragEnded() {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2015-11-17 19:20:13 +01:00
|
|
|
}
|
|
|
|
|
2017-05-12 20:28:25 +02:00
|
|
|
void CefBrowserPlatformDelegate::AccessibilityEventReceived(
|
2018-06-08 18:53:10 +02:00
|
|
|
const content::AXEventNotificationDetails& eventData) {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2017-05-12 20:28:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserPlatformDelegate::AccessibilityLocationChangesReceived(
|
|
|
|
const std::vector<content::AXLocationChangeNotificationDetails>& locData) {
|
2023-05-08 17:07:57 +02:00
|
|
|
DCHECK(false);
|
2017-05-12 20:28:25 +02:00
|
|
|
}
|
|
|
|
|
2019-07-17 20:47:27 +02:00
|
|
|
gfx::Point CefBrowserPlatformDelegate::GetDialogPosition(
|
|
|
|
const gfx::Size& size) {
|
2022-06-02 11:49:50 +02:00
|
|
|
const gfx::Size& max_size = GetMaximumDialogSize();
|
|
|
|
return gfx::Point((max_size.width() - size.width()) / 2,
|
|
|
|
(max_size.height() - size.height()) / 2);
|
2019-07-17 20:47:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
gfx::Size CefBrowserPlatformDelegate::GetMaximumDialogSize() {
|
2023-01-02 23:59:03 +01:00
|
|
|
if (!web_contents_) {
|
2022-06-02 11:49:50 +02:00
|
|
|
return gfx::Size();
|
2023-01-02 23:59:03 +01:00
|
|
|
}
|
2022-06-02 11:49:50 +02:00
|
|
|
|
|
|
|
// The dialog should try to fit within the overlay for the web contents.
|
|
|
|
// Note that, for things like print preview, this is just a suggested maximum.
|
|
|
|
return web_contents_->GetContainerBounds().size();
|
2019-07-17 20:47:27 +02:00
|
|
|
}
|
|
|
|
|
2020-07-03 22:13:27 +02:00
|
|
|
void CefBrowserPlatformDelegate::SetAutoResizeEnabled(bool enabled,
|
|
|
|
const CefSize& min_size,
|
|
|
|
const CefSize& max_size) {
|
2020-07-04 20:21:34 +02:00
|
|
|
NOTIMPLEMENTED();
|
2020-07-03 22:13:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserPlatformDelegate::SetAccessibilityState(
|
|
|
|
cef_state_t accessibility_state) {
|
2020-07-04 20:21:34 +02:00
|
|
|
NOTIMPLEMENTED();
|
2020-07-03 22:13:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
bool CefBrowserPlatformDelegate::IsPrintPreviewSupported() const {
|
2020-07-04 20:21:34 +02:00
|
|
|
return true;
|
2020-07-03 22:13:27 +02:00
|
|
|
}
|
|
|
|
|
2022-02-17 19:17:29 +01:00
|
|
|
void CefBrowserPlatformDelegate::Find(const CefString& searchText,
|
2020-07-03 22:13:27 +02:00
|
|
|
bool forward,
|
|
|
|
bool matchCase,
|
|
|
|
bool findNext) {
|
2020-07-04 20:21:34 +02:00
|
|
|
NOTIMPLEMENTED();
|
2020-07-03 22:13:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CefBrowserPlatformDelegate::StopFinding(bool clearSelection) {
|
2020-07-04 20:21:34 +02:00
|
|
|
NOTIMPLEMENTED();
|
2019-07-17 20:47:27 +02:00
|
|
|
}
|
|
|
|
|
2015-11-17 19:20:13 +01:00
|
|
|
// static
|
2020-01-23 22:58:01 +01:00
|
|
|
int CefBrowserPlatformDelegate::TranslateWebEventModifiers(
|
2023-06-01 16:06:15 +02:00
|
|
|
uint32_t cef_modifiers) {
|
2020-01-23 22:58:01 +01:00
|
|
|
int result = 0;
|
2015-11-17 19:20:13 +01:00
|
|
|
// Set modifiers based on key state.
|
2023-01-02 23:59:03 +01:00
|
|
|
if (cef_modifiers & EVENTFLAG_CAPS_LOCK_ON) {
|
2021-07-23 18:40:13 +02:00
|
|
|
result |= blink::WebInputEvent::kCapsLockOn;
|
2023-01-02 23:59:03 +01:00
|
|
|
}
|
|
|
|
if (cef_modifiers & EVENTFLAG_SHIFT_DOWN) {
|
2020-01-23 22:58:01 +01:00
|
|
|
result |= blink::WebInputEvent::kShiftKey;
|
2023-01-02 23:59:03 +01:00
|
|
|
}
|
|
|
|
if (cef_modifiers & EVENTFLAG_CONTROL_DOWN) {
|
2020-01-23 22:58:01 +01:00
|
|
|
result |= blink::WebInputEvent::kControlKey;
|
2023-01-02 23:59:03 +01:00
|
|
|
}
|
|
|
|
if (cef_modifiers & EVENTFLAG_ALT_DOWN) {
|
2020-01-23 22:58:01 +01:00
|
|
|
result |= blink::WebInputEvent::kAltKey;
|
2023-01-02 23:59:03 +01:00
|
|
|
}
|
|
|
|
if (cef_modifiers & EVENTFLAG_LEFT_MOUSE_BUTTON) {
|
2020-01-23 22:58:01 +01:00
|
|
|
result |= blink::WebInputEvent::kLeftButtonDown;
|
2023-01-02 23:59:03 +01:00
|
|
|
}
|
|
|
|
if (cef_modifiers & EVENTFLAG_MIDDLE_MOUSE_BUTTON) {
|
2020-01-23 22:58:01 +01:00
|
|
|
result |= blink::WebInputEvent::kMiddleButtonDown;
|
2023-01-02 23:59:03 +01:00
|
|
|
}
|
|
|
|
if (cef_modifiers & EVENTFLAG_RIGHT_MOUSE_BUTTON) {
|
2020-01-23 22:58:01 +01:00
|
|
|
result |= blink::WebInputEvent::kRightButtonDown;
|
2023-01-02 23:59:03 +01:00
|
|
|
}
|
|
|
|
if (cef_modifiers & EVENTFLAG_COMMAND_DOWN) {
|
2021-07-23 18:40:13 +02:00
|
|
|
result |= blink::WebInputEvent::kMetaKey;
|
2023-01-02 23:59:03 +01:00
|
|
|
}
|
|
|
|
if (cef_modifiers & EVENTFLAG_NUM_LOCK_ON) {
|
2020-01-23 22:58:01 +01:00
|
|
|
result |= blink::WebInputEvent::kNumLockOn;
|
2023-01-02 23:59:03 +01:00
|
|
|
}
|
|
|
|
if (cef_modifiers & EVENTFLAG_IS_KEY_PAD) {
|
2021-07-19 17:52:36 +02:00
|
|
|
result |= blink::WebInputEvent::kIsKeyPad;
|
2023-01-02 23:59:03 +01:00
|
|
|
}
|
|
|
|
if (cef_modifiers & EVENTFLAG_IS_LEFT) {
|
2020-01-23 22:58:01 +01:00
|
|
|
result |= blink::WebInputEvent::kIsLeft;
|
2023-01-02 23:59:03 +01:00
|
|
|
}
|
|
|
|
if (cef_modifiers & EVENTFLAG_IS_RIGHT) {
|
2020-01-23 22:58:01 +01:00
|
|
|
result |= blink::WebInputEvent::kIsRight;
|
2023-01-02 23:59:03 +01:00
|
|
|
}
|
|
|
|
if (cef_modifiers & EVENTFLAG_ALTGR_DOWN) {
|
2021-07-19 17:52:36 +02:00
|
|
|
result |= blink::WebInputEvent::kAltGrKey;
|
2023-01-02 23:59:03 +01:00
|
|
|
}
|
|
|
|
if (cef_modifiers & EVENTFLAG_IS_REPEAT) {
|
2021-07-19 17:52:36 +02:00
|
|
|
result |= blink::WebInputEvent::kIsAutoRepeat;
|
2023-01-02 23:59:03 +01:00
|
|
|
}
|
2020-01-23 22:58:01 +01:00
|
|
|
return result;
|
2015-11-17 19:20:13 +01:00
|
|
|
}
|