Browse Source

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

Backports https://chromium-review.googlesource.com/c/chromium/src/+/1917603
Robo 5 years ago
parent
commit
1c8177c542

+ 1 - 0
patches/chromium/.patches

@@ -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

+ 2 - 2
patches/chromium/can_create_window.patch

@@ -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,

+ 1 - 1
patches/chromium/disable_color_correct_rendering.patch

@@ -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 {

+ 31 - 0
patches/chromium/make_autocorrect_off_and_spellcheck_false_disable_touch_bar_typing.patch

@@ -0,0 +1,31 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Sidney=20San=20Mart=C3=ADn?= <[email protected]>
+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 <[email protected]>
+Commit-Queue: Sidney San Martín <[email protected]>
+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();