Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsPromoView.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsPromoView.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsPromoView.java |
| index b1370ffc78adb7cbf8e1945ed1cc1d9b47adef06..73ec686c15cfba628715951c13ac9fb19d3fe62b 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsPromoView.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsPromoView.java |
| @@ -88,6 +88,11 @@ public class RecentTabsPromoView extends FrameLayout implements AndroidSyncSetti |
| * Called when user attempts to create a new account. |
| */ |
| void onNewAccount(); |
| + |
| + /** |
| + * Called when a user cancels the account sign in process. |
| + */ |
| + void onAccountSelectionCancelled(); |
| } |
| private static final int PROMO_TYPE_SIGN_IN = 0; |
| @@ -245,17 +250,13 @@ public class RecentTabsPromoView extends FrameLayout implements AndroidSyncSetti |
| signInPromoView.getLayoutParams().height = LayoutParams.WRAP_CONTENT; |
| ((FrameLayout.LayoutParams) signInPromoView.getLayoutParams()).gravity = Gravity.CENTER; |
| signInPromoView.configureForRecentTabsPage(); |
| - signInPromoView.setCanCancel(false); |
| signInPromoView.setListener(new AccountFirstRunView.Listener() { |
| - @Override |
| - public void onAccountSelectionConfirmed(String accountName) { |
| - if (mUserActionListener != null) mUserActionListener.onAccountSelectionConfirmed(); |
| - SigninManager.startInteractiveSignIn(accountName, mActivity); |
| - } |
| + private String mAccountName; |
| @Override |
| public void onAccountSelectionCanceled() { |
| - assert false : "Button should be hidden"; |
| + assert mUserActionListener != null : "A UserActionListener should be provided"; |
|
newt (away)
2016/02/09 23:08:12
Personally, I'd omit the string attached to this a
PEConn
2016/02/11 14:44:56
Done.
|
| + mUserActionListener.onAccountSelectionCancelled(); |
| } |
| @Override |
| @@ -266,12 +267,19 @@ public class RecentTabsPromoView extends FrameLayout implements AndroidSyncSetti |
| } |
| @Override |
| - public void onSigningInCompleted(String accountName) { |
| - assert false : "Button should be hidden"; |
| + public void onAccountSelected(String accountName) { |
| + mAccountName = accountName; |
| + } |
| + |
| + @Override |
| + public void onDoneClicked() { |
| + if (mUserActionListener != null) mUserActionListener.onAccountSelectionConfirmed(); |
| + |
| + SigninManager.startInteractiveSignIn(mAccountName, mActivity); |
| } |
| @Override |
| - public void onSettingsButtonClicked(String accountName) { |
| + public void onSettingsClicked() { |
| assert false : "Button should be hidden"; |
| } |