electron/patches/chromium/webview_cross_drag.patch

41 строка
1.9 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Anonymous <anonymous@electronjs.org>
Date: Thu, 20 Sep 2018 17:47:04 -0700
Subject: webview_cross_drag.patch
This allows dragging and dropping between <webview>s.
Originally landed in https://github.com/electron/libchromiumcontent/pull/267
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc
index 1aa844b66d149be252f4757ed656cc6bccb2ac8b..b03507679029ccb3beb3a8984b1449afead539c6 100644
--- a/content/browser/web_contents/web_contents_view_aura.cc
+++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -881,10 +881,7 @@ bool WebContentsViewAura::IsValidDragTarget(
// TODO(https://crbug.com/1266953): There are some known gaps caused by
// comparing `RenderViewHost` IDs, as `RenderViewHost` ID is not really a
// strong signal for page identity.
- return !drag_start_ ||
- target_rwh->GetProcess()->GetID() == drag_start_->process_id ||
- GetRenderViewHostID(web_contents_->GetRenderViewHost()) !=
- drag_start_->view_id;
+ return true;
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/content/browser/web_contents/web_drag_dest_mac.mm b/content/browser/web_contents/web_drag_dest_mac.mm
index 6455404fdccab1fffceef4b8d291c137d3a448c4..483b0b5b689da03f0d7e43576fa73275197f5a95 100644
--- a/content/browser/web_contents/web_drag_dest_mac.mm
+++ b/content/browser/web_contents/web_drag_dest_mac.mm
@@ -385,9 +385,7 @@ - (void)setDragStartTrackersForProcess:(int)processID {
}
- (bool)isValidDragTarget:(content::RenderWidgetHostImpl*)targetRWH {
- return targetRWH->GetProcess()->GetID() == _dragStartProcessID ||
- GetRenderViewHostID(_webContents->GetRenderViewHost()) !=
- _dragStartViewID;
+ return YES;
}
@end