Commit 246f8e91 authored by Natalie Chouinard's avatar Natalie Chouinard Committed by Commit Bot

Add launchSettingsPage for top-level Settings

Add another launchSettingsPage method for launching the top-level
Settings page, rather than relying on caller to pass null.

Change-Id: I144549cb237ef15073146d4881f711971aba6a0d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2013343Reviewed-by: default avatarSky Malice <skym@chromium.org>
Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Commit-Queue: Natalie Chouinard <chouinard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#733814}
parent 1dfdd711
...@@ -2002,7 +2002,7 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent> ...@@ -2002,7 +2002,7 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
} }
if (id == R.id.preferences_id) { if (id == R.id.preferences_id) {
SettingsLauncher.getInstance().launchSettingsPage(this, null); SettingsLauncher.getInstance().launchSettingsPage(this);
RecordUserAction.record("MobileMenuSettings"); RecordUserAction.record("MobileMenuSettings");
} }
......
...@@ -42,7 +42,6 @@ import org.chromium.chrome.browser.payments.ui.PaymentRequestUI; ...@@ -42,7 +42,6 @@ import org.chromium.chrome.browser.payments.ui.PaymentRequestUI;
import org.chromium.chrome.browser.payments.ui.SectionInformation; import org.chromium.chrome.browser.payments.ui.SectionInformation;
import org.chromium.chrome.browser.payments.ui.ShoppingCart; import org.chromium.chrome.browser.payments.ui.ShoppingCart;
import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.settings.MainPreferences;
import org.chromium.chrome.browser.settings.SettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncher;
import org.chromium.chrome.browser.ssl.SecurityStateModel; import org.chromium.chrome.browser.ssl.SecurityStateModel;
import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.Tab;
...@@ -2282,7 +2281,7 @@ public class PaymentRequestImpl ...@@ -2282,7 +2281,7 @@ public class PaymentRequestImpl
return; return;
} }
SettingsLauncher.getInstance().launchSettingsPage(context, MainPreferences.class); SettingsLauncher.getInstance().launchSettingsPage(context);
} }
@Override @Override
......
...@@ -37,6 +37,15 @@ public class SettingsLauncher { ...@@ -37,6 +37,15 @@ public class SettingsLauncher {
sInstanceForTests = getter; sInstanceForTests = getter;
} }
/**
* Launches the top-level settings page.
*
* @param context The current Activity, or an application context if no Activity is available.
*/
public void launchSettingsPage(Context context) {
launchSettingsPage(context, null);
}
/** /**
* Launches settings, either on the top-level page or on a subpage. * Launches settings, either on the top-level page or on a subpage.
* *
......
...@@ -79,7 +79,7 @@ public class SharedClipboardShareActivity ...@@ -79,7 +79,7 @@ public class SharedClipboardShareActivity
chromeSettingsButton.setVisibility(View.VISIBLE); chromeSettingsButton.setVisibility(View.VISIBLE);
chromeSettingsButton.setOnClickListener(view -> { chromeSettingsButton.setOnClickListener(view -> {
SettingsLauncher.getInstance().launchSettingsPage( SettingsLauncher.getInstance().launchSettingsPage(
ContextUtils.getApplicationContext(), null); ContextUtils.getApplicationContext());
}); });
} }
......
...@@ -394,7 +394,7 @@ public class VrBrowserTransitionTest { ...@@ -394,7 +394,7 @@ public class VrBrowserTransitionTest {
VrShellDelegateUtils.getDelegateInstance().overrideDaydreamApiForTesting(mockApiWithDoff); VrShellDelegateUtils.getDelegateInstance().overrideDaydreamApiForTesting(mockApiWithDoff);
TestThreadUtils.runOnUiThreadBlocking(() -> { TestThreadUtils.runOnUiThreadBlocking(() -> {
SettingsLauncher.getInstance().launchSettingsPage(context, null); SettingsLauncher.getInstance().launchSettingsPage(context);
VrShellDelegateUtils.getDelegateInstance().acceptDoffPromptForTesting(); VrShellDelegateUtils.getDelegateInstance().acceptDoffPromptForTesting();
}); });
CriteriaHelper.pollUiThread(() -> { CriteriaHelper.pollUiThread(() -> {
......
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