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

Unified Diff: chrome/android/testshell/java/src/org/chromium/chrome/testshell/sync/AccountChooserFragment.java

Issue 184493006: Rename to ChromiumTestShell package from testshell to shell (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix py lint Created 6 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/testshell/java/src/org/chromium/chrome/testshell/sync/AccountChooserFragment.java
diff --git a/chrome/android/testshell/java/src/org/chromium/chrome/testshell/sync/AccountChooserFragment.java b/chrome/android/testshell/java/src/org/chromium/chrome/testshell/sync/AccountChooserFragment.java
deleted file mode 100644
index 20e34f7ff2cf9b73e06f1d38c1d4dccfff086475..0000000000000000000000000000000000000000
--- a/chrome/android/testshell/java/src/org/chromium/chrome/testshell/sync/AccountChooserFragment.java
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright 2013 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.testshell.sync;
-
-import android.app.AlertDialog;
-import android.app.Dialog;
-import android.app.DialogFragment;
-import android.content.DialogInterface;
-import android.os.Bundle;
-
-import org.chromium.chrome.testshell.R;
-import org.chromium.sync.signin.AccountManagerHelper;
-
-import java.util.List;
-
-/**
- * The fragment to show when the user is given the option to sign in to Chromium.
- *
- * It lists the available Google accounts on the device and makes the user choose one.
- */
-public class AccountChooserFragment extends DialogFragment
- implements DialogInterface.OnClickListener {
-
- private String[] mAccounts;
- private int mSelectedAccount;
-
- @Override
- public Dialog onCreateDialog(Bundle savedInstanceState) {
- List<String> accountsList = AccountManagerHelper.get(getActivity()).getGoogleAccountNames();
- mAccounts = accountsList.toArray(new String[accountsList.size()]);
- return new AlertDialog.Builder(getActivity(), AlertDialog.THEME_HOLO_LIGHT)
- .setTitle(R.string.signin_select_account)
- .setSingleChoiceItems(mAccounts, mSelectedAccount, this)
- .setPositiveButton(R.string.signin_sign_in, this)
- .setNegativeButton(R.string.signin_cancel, this)
- .create();
- }
-
- @Override
- public void onClick(DialogInterface dialog, int which) {
- switch (which) {
- case DialogInterface.BUTTON_POSITIVE: {
- selectAccount(mAccounts[mSelectedAccount]);
- break;
- }
- case DialogInterface.BUTTON_NEGATIVE: {
- dismiss();
- break;
- }
- default: {
- mSelectedAccount = which;
- break;
- }
- }
- }
-
- private void selectAccount(String accountName) {
- SyncController.get(getActivity()).signIn(getActivity(), accountName);
- }
-}

Powered by Google App Engine
This is Rietveld 408576698