Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2238)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsPromoView.java

Issue 1574273002: Unify and Improve the Sign-In and Sync Confirmation Screens on Clank. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 3ef198065293502f757f204bfd7562eb34cff537..f84cdee70707620788a87e4223c67a72b266a88e 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
@@ -93,6 +93,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;
@@ -249,18 +254,14 @@ public class RecentTabsPromoView extends FrameLayout implements AndroidSyncSetti
signInPromoView.init(mModel.getProfileDataCache());
signInPromoView.getLayoutParams().height = LayoutParams.WRAP_CONTENT;
((FrameLayout.LayoutParams) signInPromoView.getLayoutParams()).gravity = Gravity.CENTER;
- signInPromoView.configureForRecentTabsPage();
- signInPromoView.setCanCancel(false);
+ signInPromoView.configureForRecentTabsOrBookmarksPage();
signInPromoView.setListener(new AccountFirstRunView.Listener() {
- @Override
- public void onAccountSelectionConfirmed(String accountName) {
- if (mUserActionListener != null) mUserActionListener.onAccountSelectionConfirmed();
- SigninManager.get(mActivity).signIn(accountName, mActivity, null);
- }
+ private String mAccountName;
@Override
public void onAccountSelectionCanceled() {
- assert false : "Button should be hidden";
+ assert mUserActionListener != null;
+ mUserActionListener.onAccountSelectionCancelled();
}
@Override
@@ -271,12 +272,18 @@ 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.get(mActivity).signIn(mAccountName, mActivity, null);
}
@Override
- public void onSettingsButtonClicked(String accountName) {
+ public void onSettingsClicked() {
assert false : "Button should be hidden";
}

Powered by Google App Engine
This is Rietveld 408576698