Commit 65060006 authored by Ioana Pandele's avatar Ioana Pandele Committed by Commit Bot

[Android]Check that ContextualSearchManager is not null before use

In order to disable the keyboard accessory within the contextual search
panel,the ManualFillingMediator calls isSearchPanelOpened() on the
ContextualSearchManager that it gets from the acivity. Since the
contextual search manager can be null, a check is required prior
to calling that method.

Bug: 887833
Change-Id: I85203cbb233a2ae7eec8a008ebd63c40bbd1a170
Reviewed-on: https://chromium-review.googlesource.com/1238473Reviewed-by: default avatarRouslan Solomakhin <rouslan@chromium.org>
Commit-Queue: Ioana Pandele <ioanap@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593616}
parent 8d8b74ad
...@@ -20,6 +20,7 @@ import org.chromium.chrome.browser.compositor.CompositorViewHolder; ...@@ -20,6 +20,7 @@ import org.chromium.chrome.browser.compositor.CompositorViewHolder;
import org.chromium.chrome.browser.compositor.layouts.Layout; import org.chromium.chrome.browser.compositor.layouts.Layout;
import org.chromium.chrome.browser.compositor.layouts.LayoutManager; import org.chromium.chrome.browser.compositor.layouts.LayoutManager;
import org.chromium.chrome.browser.compositor.layouts.SceneChangeObserver; import org.chromium.chrome.browser.compositor.layouts.SceneChangeObserver;
import org.chromium.chrome.browser.contextualsearch.ContextualSearchManager;
import org.chromium.chrome.browser.fullscreen.FullscreenOptions; import org.chromium.chrome.browser.fullscreen.FullscreenOptions;
import org.chromium.chrome.browser.tab.EmptyTabObserver; import org.chromium.chrome.browser.tab.EmptyTabObserver;
import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.Tab;
...@@ -191,7 +192,11 @@ class ManualFillingMediator ...@@ -191,7 +192,11 @@ class ManualFillingMediator
if (!mKeyboardAccessory.hasContents()) return; // Exit early to not affect the layout. if (!mKeyboardAccessory.hasContents()) return; // Exit early to not affect the layout.
if (isShowing) { if (isShowing) {
// Don't open the accessory inside the contextual search panel. // Don't open the accessory inside the contextual search panel.
if (mActivity.getContextualSearchManager().isSearchPanelOpened()) return; ContextualSearchManager contextualSearchManager =
mActivity.getContextualSearchManager();
if (contextualSearchManager != null && contextualSearchManager.isSearchPanelOpened()) {
return;
}
mKeyboardAccessory.requestShowing(); mKeyboardAccessory.requestShowing();
mActivity.getFullscreenManager().setBottomControlsHeight(calculateAccessoryBarHeight()); mActivity.getFullscreenManager().setBottomControlsHeight(calculateAccessoryBarHeight());
mKeyboardAccessory.closeActiveTab(); mKeyboardAccessory.closeActiveTab();
......
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