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

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

Issue 2710323003: 🏠 Close the bottom sheet when opening link in incognito (Closed)
Patch Set: Properly make ContentSuggestionsActivity compile Created 3 years, 10 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/ntp/NewTabPage.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
index 7e0fe007df6682abc035f7a692963a73b2ab9107..c953e935c4ffe4baccafcbb048cfbe2d4235331c 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java
@@ -29,6 +29,7 @@
import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.ChromeSwitches;
import org.chromium.chrome.browser.NativePage;
+import org.chromium.chrome.browser.NativePageHost;
import org.chromium.chrome.browser.UrlConstants;
import org.chromium.chrome.browser.compositor.layouts.content.InvalidationAwareThumbnailProvider;
import org.chromium.chrome.browser.download.DownloadManagerService;
@@ -194,8 +195,9 @@ public static void setSuggestionsSourceForTests(SuggestionsSource suggestionsSou
extends SuggestionsUiDelegateImpl implements NewTabPageManager {
public NewTabPageManagerImpl(SuggestionsSource suggestionsSource,
SuggestionsMetricsReporter metricsReporter,
- SuggestionsNavigationDelegate navigationDelegate, Profile profile, Tab currentTab) {
- super(suggestionsSource, metricsReporter, navigationDelegate, profile, currentTab);
+ SuggestionsNavigationDelegate navigationDelegate, Profile profile,
+ NativePageHost nativePageHost) {
+ super(suggestionsSource, metricsReporter, navigationDelegate, profile, nativePageHost);
}
@Override
@@ -370,23 +372,25 @@ public void openMostVisitedItem(int windowDisposition, Tile tile) {
/**
* Constructs a NewTabPage.
* @param activity The activity used for context to create the new tab page's View.
- * @param tab The Tab that is showing this new tab page.
+ * @param nativePageHost The host that is showing this new tab page.
* @param tabModelSelector The TabModelSelector used to open tabs.
*/
- public NewTabPage(ChromeActivity activity, Tab tab, TabModelSelector tabModelSelector) {
+ public NewTabPage(ChromeActivity activity, NativePageHost nativePageHost,
+ TabModelSelector tabModelSelector) {
mConstructedTimeNs = System.nanoTime();
TraceEvent.begin(TAG);
- mTab = tab;
+ mTab = nativePageHost.getActiveTab();
mTabModelSelector = tabModelSelector;
- Profile profile = tab.getProfile();
+ Profile profile = mTab.getProfile();
mSnippetsBridge = new SnippetsBridge(profile);
SuggestionsNavigationDelegateImpl navigationDelegate =
- new SuggestionsNavigationDelegateImpl(activity, profile, tab, tabModelSelector);
+ new SuggestionsNavigationDelegateImpl(
+ activity, profile, nativePageHost, tabModelSelector);
mNewTabPageManager = new NewTabPageManagerImpl(
- mSnippetsBridge, mSnippetsBridge, navigationDelegate, profile, tab);
+ mSnippetsBridge, mSnippetsBridge, navigationDelegate, profile, nativePageHost);
mTileGroupDelegate = new NewTabPageTileGroupDelegate(
activity, profile, tabModelSelector, navigationDelegate);

Powered by Google App Engine
This is Rietveld 408576698