Commit e9388fc6 authored by Alice Wang's avatar Alice Wang Committed by Commit Bot

[Signin][Android] Remove ChromeSigninController from PasswordManagerLauncher

This CL replaces ChromeSigninController with IdentityManager in
PasswordManagerLauncher.

Bug: 1049613
Change-Id: I4d6fc91bbc2a41dad0fa97ac1ddb212f02e9a5a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2043883
Commit-Queue: Alice Wang <aliceywang@chromium.org>
Reviewed-by: default avatarBoris Sazonov <bsazonov@chromium.org>
Reviewed-by: default avatarTanmoy Mollik <triploblastic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#750967}
parent b0b5e939
......@@ -17,8 +17,8 @@ import org.chromium.chrome.browser.password_manager.settings.PasswordSettings;
import org.chromium.chrome.browser.preferences.Pref;
import org.chromium.chrome.browser.preferences.PrefServiceBridge;
import org.chromium.chrome.browser.settings.SettingsLauncher;
import org.chromium.chrome.browser.signin.IdentityServicesProvider;
import org.chromium.chrome.browser.sync.ProfileSyncService;
import org.chromium.components.signin.ChromeSigninController;
import org.chromium.components.sync.ModelType;
import org.chromium.content_public.browser.WebContents;
import org.chromium.ui.base.WindowAndroid;
......@@ -74,8 +74,7 @@ public class PasswordManagerLauncher {
}
public static boolean isSyncingPasswordsWithoutCustomPassphrase() {
ChromeSigninController signInController = ChromeSigninController.get();
if (signInController == null || !signInController.isSignedIn()) return false;
if (!IdentityServicesProvider.get().getIdentityManager().hasPrimaryAccount()) return false;
ProfileSyncService profileSyncService = ProfileSyncService.get();
if (profileSyncService == null
......
......@@ -104,7 +104,7 @@ import org.chromium.chrome.browser.settings.SettingsLauncher;
import org.chromium.chrome.browser.sync.ProfileSyncService;
import org.chromium.chrome.test.ChromeBrowserTestRule;
import org.chromium.chrome.test.util.browser.Features;
import org.chromium.components.signin.ChromeSigninController;
import org.chromium.chrome.test.util.browser.signin.SigninTestUtil;
import org.chromium.components.sync.ModelType;
import org.chromium.content_public.browser.test.util.CriteriaHelper;
import org.chromium.content_public.browser.test.util.TestThreadUtils;
......@@ -620,8 +620,8 @@ public class PasswordSettingsTest {
// Add a password entry, because the link is only displayed if the password list is not
// empty.
setPasswordSource(new SavedPasswordEntry("https://example.com", "test user", "password"));
ChromeSigninController.get().setSignedInAccountName("Test Account");
overrideProfileSyncService(false, false);
SigninTestUtil.addAndSignInTestAccount();
final SettingsActivity settingsActivity = SettingsActivityTest.startSettingsActivity(
InstrumentationRegistry.getInstrumentation(), PasswordSettings.class.getName());
......@@ -642,8 +642,8 @@ public class PasswordSettingsTest {
// Add a password entry, because the link is only displayed if the password list is not
// empty.
setPasswordSource(new SavedPasswordEntry("https://example.com", "test user", "password"));
ChromeSigninController.get().setSignedInAccountName("Test Account");
overrideProfileSyncService(false, true);
SigninTestUtil.addAndSignInTestAccount();
final SettingsActivity settingsActivity = SettingsActivityTest.startSettingsActivity(
InstrumentationRegistry.getInstrumentation(), PasswordSettings.class.getName());
......@@ -664,8 +664,8 @@ public class PasswordSettingsTest {
// Add a password entry, because the link is only displayed if the password list is not
// empty.
setPasswordSource(new SavedPasswordEntry("https://example.com", "test user", "password"));
ChromeSigninController.get().setSignedInAccountName("Test Account");
overrideProfileSyncService(true, true);
SigninTestUtil.addAndSignInTestAccount();
final SettingsActivity settingsActivity = SettingsActivityTest.startSettingsActivity(
InstrumentationRegistry.getInstrumentation(), PasswordSettings.class.getName());
......
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