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

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, 1 month 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 6cb1f91b21014de41ba51ae07b81e1ddb8ffc665..2e5c9e3035cead8c6c9d891d17293fe1d8ea1407 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
@@ -134,6 +134,9 @@ public class NewTabPageView extends FrameLayout
/** Opens a given URL in the current tab. */
void open(String url);
+ /** Opens the recent tabs page in the current tab. */
+ void navigateToInterests();
+
/**
* Animates the search box up into the omnibox and bring up the keyboard.
* @param beginVoiceSearch Whether to begin a voice search.
@@ -307,6 +310,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);
@@ -325,6 +334,11 @@ public class NewTabPageView extends FrameLayout
mSnippetsView.setLayoutManager(new LinearLayoutManager(getContext()));
mSnippetsManager = new SnippetsManager(mManager, mSnippetsView);
}
+
+ // Set up interests
+ if (CommandLine.getInstance().hasSwitch(ChromeSwitches.ENABLE_NTP_INTERESTS)) {
knn 2015/12/02 14:18:59 Can we check if user is signed in here?
PEConn 2015/12/08 17:27:50 Done.
+ toolbar.getInterestsButton().setVisibility(View.VISIBLE);
+ }
}
private int getTabsMovedIllustration() {

Powered by Google App Engine
This is Rietveld 408576698