| 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() {
|
|
|