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

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

Issue 1103163004: [Contextual Search] Remove opt-in code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing Donn's comments Created 5 years, 7 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 d6b0b12befc22e3975648a3aea09878b798a3107..eab9307b34348b61f74e87c51a8f155cf08a41cb 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
@@ -23,7 +23,6 @@ public class ContextualSearchPanel extends ContextualSearchPanelAnimation
UNDEFINED,
CLOSED,
PEEKED,
- PROMO,
EXPANDED,
MAXIMIZED;
}
@@ -146,7 +145,7 @@ public class ContextualSearchPanel extends ContextualSearchPanelAnimation
}
@Override
- protected boolean isPanelPromoAvailable() {
+ protected boolean isPromoAvailable() {
return mManagementDelegate != null && mManagementDelegate.isOptOutPromoAvailable();
}
@@ -154,6 +153,7 @@ public class ContextualSearchPanel extends ContextualSearchPanelAnimation
public void onPromoButtonClick(boolean accepted) {
super.onPromoButtonClick(accepted);
mManagementDelegate.logPromoOutcome();
+ setIsPromoActive(false);
}
@Override
@@ -236,19 +236,7 @@ public class ContextualSearchPanel extends ContextualSearchPanelAnimation
if (mManagementDelegate.isRunningInCompatibilityMode()) {
mManagementDelegate.openResolvedSearchUrlInNewTab();
} else {
- // NOTE(pedrosimonetti): If the promo is active and getPromoContentHeight()
- // returns -1 that means that the promo page hasn't finished loading, and
- // therefore it wasn't possible to calculate the height of the promo contents.
- // This will only happen if the user taps on a word that will trigger the
- // promo, and then quickly taps on the peeking bar, before the promo page
- // (which is local) finishes loading.
- //
- // TODO(pedrosimonetti): For now, we're simply ignoring the tap action in
- // that case. Consider implementing a better approach, where the Panel
- // would auto-expand once the height is calculated.
- if (!getIsPromoActive() || getPromoContentHeight() != -1) {
- expandPanel(StateChangeReason.SEARCH_BAR_TAP);
- }
+ expandPanel(StateChangeReason.SEARCH_BAR_TAP);
}
} else if (isExpanded()) {
peekPanel(StateChangeReason.SEARCH_BAR_TAP);
@@ -398,24 +386,6 @@ public class ContextualSearchPanel extends ContextualSearchPanelAnimation
}
@Override
- public void setPromoContentHeight(float height) {
- // NOTE(pedrosimonetti): exposing superclass method to the interface.
- super.setPromoContentHeight(height);
- }
-
- @Override
- public void setShouldHidePromoHeader(boolean shouldHidePromoHeader) {
- // NOTE(pedrosimonetti): exposing superclass method to the interface.
- super.setShouldHidePromoHeader(shouldHidePromoHeader);
- }
-
- @Override
- public void animateAfterFirstRunSuccess() {
- // NOTE(pedrosimonetti): exposing superclass method to the interface.
- super.animateAfterFirstRunSuccess();
- }
-
- @Override
public void onLoadStarted() {
setProgressBarCompletion(0);
setProgressBarVisible(true);

Powered by Google App Engine
This is Rietveld 408576698