-
Notifications
You must be signed in to change notification settings - Fork 15.1k
/
fix_route_mouse_event_navigations_through_the_web_contents_delegate.patch
34 lines (30 loc) · 1.65 KB
/
fix_route_mouse_event_navigations_through_the_web_contents_delegate.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <sattard@slack-corp.com>
Date: Fri, 14 Feb 2020 13:35:47 -0800
Subject: fix: route mouse event navigations through the web_contents delegate
This ensures that embedders can handle browser-side mouse navigations
themselves. We need this so that we can correctly ensure that processes
are not restarted for in-document navigations.
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/1769525
This patch can be removed once app.allowRendererProcessReuse is forced
to true as then Chromiums assumptions around processes become correct.
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 5234e86d8f10533c4f8c6992a328d521c1850cea..3049fe6aa54b1f57e94769fcf300e02d13c361da 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3076,11 +3076,13 @@ bool WebContentsImpl::HandleMouseEvent(const blink::WebMouseEvent& event) {
WebContentsImpl* outermost = GetOutermostWebContents();
if (event.button == blink::WebPointerProperties::Button::kBack &&
outermost->controller_.CanGoBack()) {
- outermost->controller_.GoBack();
+ if (delegate_->OnGoToEntryOffset(-1))
+ outermost->controller_.GoBack();
return true;
} else if (event.button == blink::WebPointerProperties::Button::kForward &&
outermost->controller_.CanGoForward()) {
- outermost->controller_.GoForward();
+ if (delegate_->OnGoToEntryOffset(1))
+ outermost->controller_.GoForward();
return true;
}
}