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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java

Issue 1050163004: [Contextual Search] Implements Opt-out promo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and rebase Created 5 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
Index: chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java
index 45fe265322f8b77cc95a55aa9716ff29855ddea7..3dc8920fce0a887a9e75a301a9b2a51c968be54f 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java
@@ -138,6 +138,12 @@ public class ContextualSearchPanel extends ContextualSearchPanelAnimation
}
}
+ @Override
+ protected boolean isPanelPromoAvailable() {
+ // TODO(donnd, pedrosimonetti): Check for field trial here.
+ return false;
+ }
+
// ============================================================================================
// Generic Event Handling
// ============================================================================================
@@ -244,7 +250,7 @@ public class ContextualSearchPanel extends ContextualSearchPanelAnimation
* @return Whether the given |y| coordinate is inside the Search Bar area.
*/
public boolean isYCoordinateInsideSearchBar(float y) {
- return !isYCoordinateInsideBasePage(y) && !isYCoordinateInsideSearchContentView(y);
+ return y >= getOffsetY() && y <= (getOffsetY() + getSearchBarHeight());
}
/**
@@ -260,7 +266,7 @@ public class ContextualSearchPanel extends ContextualSearchPanelAnimation
* @return The vertical offset of the Search Content View in dp.
*/
public float getSearchContentViewOffsetY() {
- return getOffsetY() + getSearchBarHeight();
+ return getOffsetY() + getSearchBarHeight() + getPromoHeight();
}
/**
@@ -452,6 +458,13 @@ public class ContextualSearchPanel extends ContextualSearchPanelAnimation
@Override
public void onSearchResultsLoaded(boolean wasPrefetch) {
+ // NOTE(pedrosimonetti): exposing superclass method to the interface.
super.onSearchResultsLoaded(wasPrefetch);
}
+
+ @Override
+ public ContextualSearchControl getContextualSearchControl() {
+ // NOTE(pedrosimonetti): exposing superclass method to the interface.
+ return super.getContextualSearchControl();
+ }
}

Powered by Google App Engine
This is Rietveld 408576698