mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
alloy: mac/linux: Support OS execution via OnProtocolExecution (fixes #1340)
This commit is contained in:
@@ -5,12 +5,30 @@
|
||||
#include "libcef/browser/browser_platform_delegate.h"
|
||||
|
||||
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
|
||||
#include "libcef/browser/thread_util.h"
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "chrome/browser/platform_util.h"
|
||||
#include "chrome/browser/shell_integration.h"
|
||||
#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"
|
||||
|
||||
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
|
||||
|
||||
CefBrowserPlatformDelegate::CefBrowserPlatformDelegate() = default;
|
||||
|
||||
CefBrowserPlatformDelegate::~CefBrowserPlatformDelegate() {
|
||||
@@ -225,6 +243,11 @@ bool CefBrowserPlatformDelegate::IsNeverComposited(
|
||||
return false;
|
||||
}
|
||||
|
||||
// static
|
||||
void CefBrowserPlatformDelegate::HandleExternalProtocol(const GURL& url) {
|
||||
CEF_POST_USER_VISIBLE_TASK(base::BindOnce(ExecuteExternalProtocol, url));
|
||||
}
|
||||
|
||||
CefEventHandle CefBrowserPlatformDelegate::GetEventHandle(
|
||||
const content::NativeWebKeyboardEvent& event) const {
|
||||
DCHECK(false);
|
||||
|
Reference in New Issue
Block a user