Commit f323251b authored by Justin DeWitt's avatar Justin DeWitt Committed by Chromium LUCI CQ

Remove ExploreSitesPage dependency on ChromeActivity

Bug: 1155360
Change-Id: Iaf0af878775f72b305fcd5c6fa0cbabcbab9cd36
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2575425Reviewed-by: default avatarBrandon Wylie <wylieb@chromium.org>
Reviewed-by: default avatarFilip Gorski <fgorski@chromium.org>
Commit-Queue: Filip Gorski <fgorski@chromium.org>
Auto-Submit: Justin DeWitt <dewittj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#834209}
parent 5081dc0c
......@@ -176,9 +176,6 @@ specific_include_rules = {
"ExploreSitesIPH\.java": [
"+chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java",
],
"ExploreSitesPage\.java": [
"+chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java",
],
"ExternalNavigationDelegateImpl\.java": [
"+chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java",
],
......
......@@ -4,6 +4,7 @@
package org.chromium.chrome.browser.explore_sites;
import android.app.Activity;
import android.content.Context;
import android.os.Parcel;
import android.os.Parcelable;
......@@ -21,7 +22,6 @@ import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.base.metrics.RecordUserAction;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.app.ChromeActivity;
import org.chromium.chrome.browser.native_page.ContextMenuManager;
import org.chromium.chrome.browser.native_page.NativePageNavigationDelegate;
import org.chromium.chrome.browser.native_page.NativePageNavigationDelegateImpl;
......@@ -29,6 +29,7 @@ import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.tab.EmptyTabObserver;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tab.TabObserver;
import org.chromium.chrome.browser.tabmodel.TabModelSelector;
import org.chromium.chrome.browser.ui.native_page.BasicNativePage;
import org.chromium.chrome.browser.ui.native_page.NativePageHost;
import org.chromium.components.browser_ui.widget.RoundedIconGenerator;
......@@ -169,7 +170,8 @@ public class ExploreSitesPage extends BasicNativePage {
/**
* Create a new instance of the explore sites page.
*/
public ExploreSitesPage(ChromeActivity activity, NativePageHost host, Tab tab) {
public ExploreSitesPage(
Activity activity, NativePageHost host, Tab tab, TabModelSelector tabModelSelector) {
super(host);
mHost = host;
......@@ -232,7 +234,7 @@ public class ExploreSitesPage extends BasicNativePage {
context.getResources().getDimensionPixelSize(textSizeDimensionResource));
NativePageNavigationDelegateImpl navDelegate = new NativePageNavigationDelegateImpl(
activity, mProfile, host, activity.getTabModelSelector(), mTab);
activity, mProfile, host, tabModelSelector, mTab);
// ExploreSitePage is recreated upon reparenting. Safe to use |activity|.
Runnable closeContextMenuCallback = activity::closeContextMenu;
......
......@@ -103,7 +103,8 @@ public class NativePageFactory {
}
protected NativePage buildExploreSitesPage(Tab tab) {
return new ExploreSitesPage(mActivity, new TabShim(tab, mActivity), tab);
return new ExploreSitesPage(
mActivity, new TabShim(tab, mActivity), tab, mActivity.getTabModelSelector());
}
protected NativePage buildHistoryPage(Tab tab) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment