2018-10-24 18:24:11 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-09-21 00:30:26 +00:00
|
|
|
From: Anonymous <anonymous@electronjs.org>
|
|
|
|
Date: Thu, 20 Sep 2018 17:47:04 -0700
|
|
|
|
Subject: webview_cross_drag.patch
|
|
|
|
|
2019-12-13 17:18:45 +00:00
|
|
|
This allows dragging and dropping between <webview>s.
|
|
|
|
|
|
|
|
Originally landed in https://github.com/electron/libchromiumcontent/pull/267
|
2018-09-21 00:30:26 +00:00
|
|
|
|
2018-09-14 05:02:16 +00:00
|
|
|
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc
|
2020-04-06 20:09:52 +00:00
|
|
|
index 025f82ede5c7105ffcf5cd834c8ab6392de672bc..84cd07bc48e680053a012a674bd4b50fcf5123af 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/content/browser/web_contents/web_contents_view_aura.cc
|
|
|
|
+++ b/content/browser/web_contents/web_contents_view_aura.cc
|
2020-04-06 20:09:52 +00:00
|
|
|
@@ -796,9 +796,7 @@ gfx::NativeView WebContentsViewAura::GetRenderWidgetHostViewParent() const {
|
2018-09-14 05:02:16 +00:00
|
|
|
|
|
|
|
bool WebContentsViewAura::IsValidDragTarget(
|
|
|
|
RenderWidgetHostImpl* target_rwh) const {
|
2020-04-06 20:09:52 +00:00
|
|
|
- return target_rwh->GetProcess()->GetID() == drag_start_process_id_ ||
|
|
|
|
- GetRenderViewHostID(web_contents_->GetRenderViewHost()) !=
|
|
|
|
- drag_start_view_id_;
|
2018-09-14 05:02:16 +00:00
|
|
|
+ return true;
|
2020-04-06 20:09:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2018-09-14 05:02:16 +00:00
|
|
|
diff --git a/content/browser/web_contents/web_drag_dest_mac.mm b/content/browser/web_contents/web_drag_dest_mac.mm
|
2020-04-06 20:09:52 +00:00
|
|
|
index b874b3c4b16ca87c9730c6caaf5788cff0ab3493..2c82d63d646c9201abd6a669b726dae0f8bec12b 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/content/browser/web_contents/web_drag_dest_mac.mm
|
|
|
|
+++ b/content/browser/web_contents/web_drag_dest_mac.mm
|
2020-04-08 15:59:14 +00:00
|
|
|
@@ -419,9 +419,7 @@ void DropCompletionCallback(
|
2018-09-14 05:02:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (bool)isValidDragTarget:(content::RenderWidgetHostImpl*)targetRWH {
|
2020-04-06 20:09:52 +00:00
|
|
|
- return targetRWH->GetProcess()->GetID() == _dragStartProcessID ||
|
|
|
|
- GetRenderViewHostID(_webContents->GetRenderViewHost()) !=
|
|
|
|
- _dragStartViewID;
|
2018-09-14 05:02:16 +00:00
|
|
|
+ return YES;
|
2020-04-06 20:09:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|