Commit d8b5505e authored by Side Yilmaz's avatar Side Yilmaz Committed by Commit Bot

Update deprecated IdentityServicesProvider function in password manager.

This CL replaces deprecated functions of IdentityServicesProvider with
the newer service getters with profile parameter.This CL passes
|Profile#getLastUsedRegularProfile| to |getIdentityManager| function.
Using always regular profile is safe, since code block is only called
for regular profile, while there is no plan to be called for
off-the-record profile.

Bug: 1041781, 1075562
Change-Id: I8253a9c6baf4b5f5d9034e61ff180da37102ae62
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2339660Reviewed-by: default avatarRamin Halavati <rhalavati@chromium.org>
Reviewed-by: default avatarIoana Pandele <ioanap@chromium.org>
Commit-Queue: Side YILMAZ <sideyilmaz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795869}
parent 9b7ca101
......@@ -17,6 +17,7 @@ import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.settings.SettingsLauncherImpl;
import org.chromium.chrome.browser.signin.IdentityServicesProvider;
import org.chromium.chrome.browser.sync.ProfileSyncService;
import org.chromium.components.signin.identitymanager.IdentityManager;
import org.chromium.components.sync.ModelType;
import org.chromium.components.user_prefs.UserPrefs;
import org.chromium.content_public.browser.WebContents;
......@@ -74,7 +75,9 @@ public class PasswordManagerLauncher {
}
public static boolean isSyncingPasswordsWithoutCustomPassphrase() {
if (!IdentityServicesProvider.get().getIdentityManager().hasPrimaryAccount()) return false;
IdentityManager identityManager = IdentityServicesProvider.get().getIdentityManager(
Profile.getLastUsedRegularProfile());
if (!identityManager.hasPrimaryAccount()) return false;
ProfileSyncService profileSyncService = ProfileSyncService.get();
if (profileSyncService == null
......
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