Commit be766ddf authored by Will Cassella's avatar Will Cassella Committed by Commit Bot

Check whether Chrome is in VR when showing keyboard accessory.

VR mode does not support keyboard accessories, so they should be
disallowed from appearing while in VR. This CL adds a check to do that.

Bug: 983649
Change-Id: I3fa80224214654060c28ef000bfe5b30ccf82212
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1707428Reviewed-by: default avatarTibor Goldschwendt <tiborg@chromium.org>
Reviewed-by: default avatarFriedrich [CET] <fhorschig@chromium.org>
Commit-Queue: Will Cassella <cassew@google.com>
Cr-Commit-Position: refs/heads/master@{#680526}
parent 60aac7a8
......@@ -96,6 +96,7 @@ junit_binary("keyboard_accessory_junit_tests") {
"//base:base_junit_test_support",
"//chrome/android:chrome_junit_test_support",
"//chrome/android:chrome_test_util_java",
"//components/module_installer/android:module_installer_stub_java",
"//third_party/junit",
"//third_party/mockito:mockito_java",
]
......
......@@ -55,6 +55,7 @@ import org.chromium.chrome.browser.tab.Tab.TabHidingType;
import org.chromium.chrome.browser.tab.TabObserver;
import org.chromium.chrome.browser.tabmodel.TabModelObserver;
import org.chromium.chrome.browser.tabmodel.TabModelSelectorTabModelObserver;
import org.chromium.chrome.browser.vr.VrModuleProvider;
import org.chromium.components.autofill.AutofillDelegate;
import org.chromium.components.autofill.AutofillSuggestion;
import org.chromium.content_public.browser.WebContents;
......@@ -427,6 +428,9 @@ class ManualFillingMediator extends EmptyTabObserver
private boolean canExtendKeyboard() {
if (!mModel.get(SHOW_WHEN_VISIBLE)) return false;
// When in VR mode, don't extend the keyboard
if (VrModuleProvider.getDelegate().isInVr()) return false;
// Don't open the accessory inside the contextual search panel.
ContextualSearchManager contextualSearch = mActivity.getContextualSearchManager();
if (contextualSearch != null && contextualSearch.isSearchPanelOpened()) return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment