fix: disable Touch Bar typing suggestions with autocorrect=off and spellcheck=false (#21192)

Backports https://chromium-review.googlesource.com/c/chromium/src/+/1917603
This commit is contained in:
Robo
2019-11-19 10:32:09 -08:00
committed by John Kleinschmidt
parent 3f148fc3aa
commit 1c8177c542
4 changed files with 35 additions and 3 deletions

View File

@@ -81,3 +81,4 @@ net_avoid_vector_const_elements.patch
feat_add_set_theme_source_to_allow_apps_to.patch
build_fix_when_building_with_enable_plugins_false.patch
x11_and_ozone_move_closing_logic_to_dwthplatform.patch
make_autocorrect_off_and_spellcheck_false_disable_touch_bar_typing.patch

View File

@@ -5,10 +5,10 @@ Subject: can_create_window.patch
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index f25b4fa183726c78fb45bbb8259eaeb13ae20659..4398cd11d7fd95a1f6d41b24b3231e0006b2b012 100644
index 523c981bbd1b635f7bcc37b560760c8316619ff4..a68e9246f5ec435becca41737cf73f6611970e88 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -3964,6 +3964,7 @@ void RenderFrameHostImpl::CreateNewWindow(
@@ -3968,6 +3968,7 @@ void RenderFrameHostImpl::CreateNewWindow(
last_committed_origin_, params->window_container_type,
params->target_url, params->referrer.To<Referrer>(),
params->frame_name, params->disposition, *params->features,

View File

@@ -20,7 +20,7 @@ to deal with color spaces. That is being tracked at
https://crbug.com/634542 and https://crbug.com/711107.
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 8f2e073cd68d9aa54ae08b4f6ef1c60795567575..50c3efcee1ec7508990a5db1bb6dc120223fec18 100644
index 49112276c539970feb2a9d97dcf6b38548838563..e41dce2bbb577d1ff9e7ed29362935db0202f1a9 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1814,6 +1814,12 @@ const gfx::ColorSpace& LayerTreeHostImpl::GetRasterColorSpace() const {

View File

@@ -0,0 +1,31 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sidney=20San=20Mart=C3=ADn?= <sdy@chromium.org>
Date: Thu, 14 Nov 2019 20:56:51 +0000
Subject: Make autocorrect=off and spellcheck=false disable Touch Bar typing
suggestions.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Bug: 1024914
Change-Id: I3ff68438b028fe38ad7270d7f90772b595f4f46e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1917603
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Sidney San Martín <sdy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715401}
diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
index 9113fb00d144d6cee789f608f8b3761b93ca7ae8..1e92b2b515056235de6277a43be207f79c94dedf 100644
--- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
+++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
@@ -2220,7 +2220,9 @@ - (void)invalidateTouchBar {
}
- (NSTouchBar*)makeTouchBar {
- if (textInputType_ != ui::TEXT_INPUT_TYPE_NONE) {
+ if (textInputType_ != ui::TEXT_INPUT_TYPE_NONE &&
+ !(textInputFlags_ & blink::kWebTextInputFlagAutocorrectOff) &&
+ !(textInputFlags_ & blink::kWebTextInputFlagSpellcheckOff)) {
candidateListTouchBarItem_.reset([[NSCandidateListTouchBarItem alloc]
initWithIdentifier:NSTouchBarItemIdentifierCandidateList]);
auto* candidateListItem = candidateListTouchBarItem_.get();