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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/signin/AddGoogleAccountDialogFragment.java

Issue 840893002: Upstream the sign out and add an account dialogs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Descriptions Created 5 years, 11 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/signin/SignOutDialogFragment.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/signin/AddGoogleAccountDialogFragment.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/AddGoogleAccountDialogFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/AddGoogleAccountDialogFragment.java
new file mode 100644
index 0000000000000000000000000000000000000000..dea47633d08be53f78a6a510ddfe2d889444ef49
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/AddGoogleAccountDialogFragment.java
@@ -0,0 +1,56 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.signin;
+
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.app.DialogFragment;
+import android.content.DialogInterface;
+import android.os.Bundle;
+
+import org.chromium.chrome.R;
+
+/**
+ * Fragment that allows user to add their Google account.
+ */
+public class AddGoogleAccountDialogFragment extends DialogFragment implements
+ DialogInterface.OnClickListener {
+
+ /**
+ * Listener for new account additions.
+ */
+ public interface AddGoogleAccountListener {
+ /**
+ * Called when the user chooses to add an account to their device.
+ */
+ public void onAddAccountClicked();
+ }
+
+ private AddGoogleAccountListener mListener;
+
+ @Override
+ public Dialog onCreateDialog(Bundle savedInstanceState) {
+ return new AlertDialog.Builder(getActivity())
+ .setTitle(R.string.add_account_title)
+ .setPositiveButton(R.string.add_account_continue, this)
+ .setNegativeButton(R.string.cancel, null)
+ .setMessage(R.string.add_account_message)
+ .create();
+ }
+
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ if (which == AlertDialog.BUTTON_POSITIVE) {
+ if (mListener != null) mListener.onAddAccountClicked();
+ }
+ }
+
+ /**
+ * @param listener Listener that should be notified when user chooses to add an account.
+ */
+ public void setListener(AddGoogleAccountListener listener) {
+ mListener = listener;
+ }
+}
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/signin/SignOutDialogFragment.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698