Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1945)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsBottomSheetContent.java

Issue 2791603004: 🏠 Defocus omnibox on bottom sheet content touch (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsBottomSheetContent.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsBottomSheetContent.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsBottomSheetContent.java
index 50e6f56a1c38912fd0340b4c1e0588c32e2fe400..48c87d2617406ea0d203d4fcb160e83862a94071 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsBottomSheetContent.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsBottomSheetContent.java
@@ -4,9 +4,11 @@
package org.chromium.chrome.browser.suggestions;
+import android.annotation.SuppressLint;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.RecyclerView.OnScrollListener;
import android.view.LayoutInflater;
+import android.view.MotionEvent;
import android.view.View;
import org.chromium.base.ApiCompatibilityUtils;
@@ -18,6 +20,7 @@ import org.chromium.chrome.browser.ntp.cards.NewTabPageAdapter;
import org.chromium.chrome.browser.ntp.snippets.SnippetsBridge;
import org.chromium.chrome.browser.ntp.snippets.SuggestionsSource;
import org.chromium.chrome.browser.offlinepages.OfflinePageBridge;
+import org.chromium.chrome.browser.omnibox.LocationBar;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.tabmodel.TabModelSelector;
import org.chromium.chrome.browser.widget.FadingShadow;
@@ -44,15 +47,14 @@ public class SuggestionsBottomSheetContent implements BottomSheet.BottomSheetCon
private final SuggestionsUiDelegateImpl mSuggestionsManager;
private final TileGroup.Delegate mTileGroupDelegate;
- public SuggestionsBottomSheetContent(
- final ChromeActivity activity, NativePageHost host, TabModelSelector tabModelSelector) {
-
+ public SuggestionsBottomSheetContent(final ChromeActivity activity, final BottomSheet sheet,
+ TabModelSelector tabModelSelector) {
Profile profile = Profile.getLastUsedProfile();
SuggestionsNavigationDelegate navigationDelegate =
- new SuggestionsNavigationDelegateImpl(activity, profile, host, tabModelSelector);
+ new SuggestionsNavigationDelegateImpl(activity, profile, sheet, tabModelSelector);
mTileGroupDelegate =
new TileGroupDelegateImpl(activity, profile, tabModelSelector, navigationDelegate);
- mSuggestionsManager = createSuggestionsDelegate(profile, navigationDelegate, host);
+ mSuggestionsManager = createSuggestionsDelegate(profile, navigationDelegate, sheet);
mView = LayoutInflater.from(activity).inflate(
R.layout.suggestions_bottom_sheet_content, null);
@@ -97,6 +99,20 @@ public class SuggestionsBottomSheetContent implements BottomSheet.BottomSheetCon
mShadowView.setVisibility(shadowVisible ? View.VISIBLE : View.GONE);
}
});
+
+ final LocationBar locationBar = (LocationBar) sheet.findViewById(R.id.location_bar);
+ mRecyclerView.setOnTouchListener(new View.OnTouchListener() {
+ @Override
+ @SuppressLint("ClickableViewAccessibility")
Theresa 2017/03/31 22:13:15 This is probably a real error. Let's add a TODO to
mdjones 2017/04/01 00:05:48 I was thinking that originally, but we are only pa
+ public boolean onTouch(View view, MotionEvent motionEvent) {
+ if (locationBar != null && locationBar.isUrlBarFocused()) {
+ locationBar.setUrlBarFocus(false);
+ }
+
+ // Never intercept the touch event.
+ return false;
+ }
+ });
}
@Override
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698