electron/patches/chromium/fix_undo_redo_broken_in_webviews.patch
Electron Bot 37db307153
chore: bump chromium to 4563763ef26ad940d4e988d7245dd (master) (#23219)
* chore: bump chromium in DEPS to 461ecae368fd0832f18e0b13e61f3561d83f0031

* update patches

* update patches

* Remove both vs browser/child split in content gn files.

https://chromium-review.googlesource.com/c/chromium/src/+/2157965

* chore: bump chromium in DEPS to 7ff3897f3104563763ef26ad940d4e988d7245dd

* update patches

* update patches

* Add ElectronKioskDelegate for extensions

https://chromium-review.googlesource.com/c/chromium/src/+/2159760

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: Electron Bot <anonymous@electronjs.org>
2020-04-23 21:55:17 -04:00

36 lines
1.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Tue, 31 Mar 2020 14:32:33 -0700
Subject: fix: undo redo broken in webviews
When propagating the undo and redo events from the menu, Chromium was not
properly sending the events to the focused webcontents on macOS. This fixes
that error. A crbug has been opened at https://bugs.chromium.org/p/chromium/issues/detail?id=1067284
and this patch will be removed when it has been resolved upstream.
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 9fe6d55cc0dbcc504cdf0eebe71899887de31b19..ef464a68a9925ecef869415ed8ba1c361448b93f 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -38,6 +38,7 @@
#include "content/browser/renderer_host/render_widget_host_input_event_router.h"
#import "content/browser/renderer_host/text_input_client_mac.h"
#import "content/browser/renderer_host/ui_events_helper.h"
+#include "content/browser/web_contents/web_contents_impl.h"
#include "content/common/text_input_state.h"
#include "content/common/view_messages.h"
#include "content/public/browser/browser_context.h"
@@ -978,7 +979,12 @@ gfx::Range RenderWidgetHostViewMac::ConvertCharacterRangeToCompositionRange(
}
WebContents* RenderWidgetHostViewMac::GetWebContents() {
- return WebContents::FromRenderViewHost(RenderViewHost::From(host()));
+ auto* wc = WebContents::FromRenderViewHost(RenderViewHost::From(host()));
+ if (wc) {
+ WebContentsImpl* web_contents_impl = static_cast<WebContentsImpl*>(wc);
+ return web_contents_impl->GetFocusedWebContents();
+ }
+ return wc;
}
bool RenderWidgetHostViewMac::GetCachedFirstRectForCharacterRange(