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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java

Issue 1459593002: Added a UI for the Interests Prototype. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/ntp/NewTabPageView.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java
index 16c39b3ef7424f483a39f1d51ccd100b08dd6eb7..43de832b80027cfae0e6b6026b9073e2788bc5ec 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java
@@ -119,6 +119,9 @@ public class NewTabPageView extends FrameLayout
/** @return Whether voice search is enabled and the microphone should be shown. */
boolean isVoiceSearchEnabled();
+ /** @return Whether the NTP Interests tab is enabled and its button should be shown. */
+ boolean isInterestsEnabled();
+
/** @return Whether the document mode opt out promo should be shown. */
boolean shouldShowOptOutPromo();
@@ -137,6 +140,9 @@ public class NewTabPageView extends FrameLayout
/** Opens a given URL in the current tab. */
void open(String url);
+ /** Opens the interests dialog. */
+ void navigateToInterests();
+
/**
* Animates the search box up into the omnibox and bring up the keyboard.
* @param beginVoiceSearch Whether to begin a voice search.
@@ -313,6 +319,12 @@ public class NewTabPageView extends FrameLayout
mManager.navigateToBookmarks();
}
});
+ toolbar.getInterestsButton().setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ mManager.navigateToInterests();
+ }
+ });
initializeSearchBoxScrollHandling();
addOnLayoutChangeListener(this);
@@ -347,6 +359,11 @@ public class NewTabPageView extends FrameLayout
}
});
}
+
+ // Set up interests
+ if (manager.isInterestsEnabled()) {
+ toolbar.getInterestsButton().setVisibility(View.VISIBLE);
+ }
}
private int getTabsMovedIllustration() {

Powered by Google App Engine
This is Rietveld 408576698