Index: chrome/android/java/src/org/chromium/chrome/browser/signin/SigninManager.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninManager.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninManager.java |
index 5d2bcd99193dba66e781bf2cc24ab0c85430129a..03fbbe1e6170c2eb5665b55b7dada418a0fca33b 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninManager.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninManager.java |
@@ -218,6 +218,17 @@ public class SigninManager implements AccountTrackerService.OnSystemAccountsSeed |
sSignInAccessPoint = accessPoint; |
} |
+ /** |
+ * Checks whether a different account was previously signed in and so the confirm data sync |
+ * dialog should be shown. |
+ * @param newAccountName The name of the proposed account. |
+ * @return Whether the previous account was different to the proposed account. |
+ */ |
+ public static boolean shouldShowDataSyncDialog(String newAccountName) { |
newt (away)
2016/02/25 18:01:32
Now that this the SigninInvestigator logic has bee
PEConn
2016/02/25 20:45:12
Done.
|
+ return SigninInvestigator.investigate(newAccountName) |
+ == InvestigatedScenario.DIFFERENT_ACCOUNT; |
+ } |
+ |
private void logSigninCompleteAccessPoint() { |
RecordHistogram.recordEnumeratedHistogram( |
"Signin.SigninCompletedAccessPoint", sSignInAccessPoint, SigninAccessPoint.MAX); |
@@ -292,7 +303,7 @@ public class SigninManager implements AccountTrackerService.OnSystemAccountsSeed |
public void onSystemAccountsSeedingComplete() { |
if (mSignInState != null && mSignInState.blockedOnAccountSeeding) { |
mSignInState.blockedOnAccountSeeding = false; |
- progressSignInFlowInvestigateScenario(); |
+ progressSignInFlowCheckPolicy(); |
} |
} |
@@ -366,7 +377,7 @@ public class SigninManager implements AccountTrackerService.OnSystemAccountsSeed |
private void progressSignInFlowSeedSystemAccounts() { |
if (AccountTrackerService.get(mContext).checkAndSeedSystemAccounts()) { |
- progressSignInFlowInvestigateScenario(); |
+ progressSignInFlowCheckPolicy(); |
} else if (AccountIdProvider.getInstance().canBeUsed(mContext)) { |
mSignInState.blockedOnAccountSeeding = true; |
} else { |
@@ -381,11 +392,11 @@ public class SigninManager implements AccountTrackerService.OnSystemAccountsSeed |
} |
/** |
- * If sign-in is interactive and the user is changing accounts, display a confirmation dialog. |
+ * Continues the signin flow by checking if there is a policy that the account is subject to. |
*/ |
- private void progressSignInFlowInvestigateScenario() { |
- if (!mSignInState.isInteractive()) { |
- progressSignInFlowCheckPolicy(); |
+ private void progressSignInFlowCheckPolicy() { |
+ if (mSignInState == null) { |
+ Log.w(TAG, "Ignoring sign in progress request as no pending sign in."); |
return; |
} |
@@ -394,41 +405,6 @@ public class SigninManager implements AccountTrackerService.OnSystemAccountsSeed |
return; |
} |
- // TODO(skym): Warn for high risk upgrade scenario, crbug.com/572754. |
- if (SigninInvestigator.investigate(mSignInState.account.name) |
- == InvestigatedScenario.DIFFERENT_ACCOUNT) { |
- mSignInState.displayedDialog = |
- ConfirmAccountChangeFragment.newInstance(mSignInState.account.name); |
- mSignInState.displayedDialog.show( |
- mSignInState.activity.getFragmentManager(), CONFIRM_ACCOUNT_CHANGED_DIALOG_TAG); |
- } else { |
- // Do not display dialog, just sign-in. |
- progressSignInFlowCheckPolicy(); |
- } |
- } |
- |
- /** |
- * Called from ConfirmAccountChangeFragment if the new account name was confirmed. |
- */ |
- void progressInteractiveSignInFlowAccountConfirmed() { |
- if (mSignInState == null || mSignInState.displayedDialog == null) { |
- // Stop if sign-in was cancelled or this is a duplicate click event. |
- return; |
- } |
- mSignInState.displayedDialog = null; |
- |
- progressSignInFlowCheckPolicy(); |
- } |
- |
- /** |
- * Continues the signin flow by checking if there is a policy that the account is subject to. |
- */ |
- private void progressSignInFlowCheckPolicy() { |
- if (mSignInState == null) { |
- Log.w(TAG, "Ignoring sign in progress request as no pending sign in."); |
- return; |
- } |
- |
if (!nativeShouldLoadPolicyForUser(mSignInState.account.name)) { |
// Proceed with the sign-in flow without checking for policy if it can be determined |
// that this account can't have management enabled based on the username. |
@@ -465,6 +441,7 @@ public class SigninManager implements AccountTrackerService.OnSystemAccountsSeed |
return; |
} |
+ // TODO(peconn): Move this and other UI interactions into AccountSigninView. |
Log.d(TAG, "Account has policy management"); |
mSignInState.displayedDialog = ConfirmManagedSigninFragment.newInstance(managementDomain); |
mSignInState.displayedDialog.show( |