From eca9c4be0e1a28edb3752d697c0f16e47c94bd8c Mon Sep 17 00:00:00 2001 From: "abhi.rathore" Date: Thu, 28 May 2015 06:18:06 -0700 Subject: [PATCH] Remove PasswordAuthenticationManager.java file that is no longer used. Patch [1] removed the password manager related code from Android. This CL cleans up the remaining traces of it by removing the PasswordAuthenticationManager.java which is still part of the repository. [1] https://codereview.chromium.org/641753002 BUG=NONE Review URL: https://codereview.chromium.org/1155273004 Cr-Commit-Position: refs/heads/master@{#331772} --- AUTHORS | 1 + .../PasswordAuthenticationManager.java | 130 --------------------- chrome/chrome_browser.gypi | 1 - 3 files changed, 1 insertion(+), 131 deletions(-) delete mode 100644 chrome/android/java/src/org/chromium/chrome/browser/password_manager/PasswordAuthenticationManager.java diff --git a/AUTHORS b/AUTHORS index d31f1119b014..22115bb53cee 100644 --- a/AUTHORS +++ b/AUTHORS @@ -13,6 +13,7 @@ Aaron Leventhal Aaron Randolph Abhijeet Kandalkar Abhishek Agarwal +Abhishek Singh Adam Roben Adam Treat Addanki Gandhi Kishor diff --git a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/PasswordAuthenticationManager.java b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/PasswordAuthenticationManager.java deleted file mode 100644 index 78e7eb345d7b..000000000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/PasswordAuthenticationManager.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright 2014 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.password_manager; - -import org.chromium.base.CalledByNative; -import org.chromium.chrome.browser.Tab; - -/** - * Allows embedders to authenticate the usage of passwords. - */ -public class PasswordAuthenticationManager { - - /** - * The delegate that allows embedders to control the authentication of passwords. - */ - public interface PasswordAuthenticationDelegate { - /** - * @return Whether password authentication is enabled. - */ - boolean isPasswordAuthenticationEnabled(); - - /** - * Requests password authentication be presented for the given tab. - * @param tab The tab containing the protected password. - * @param callback The callback to be triggered on authentication result. - */ - void requestAuthentication(Tab tab, PasswordAuthenticationCallback callback); - - /** - * @return The message to be displayed in the save password infobar that will allow - * the user to opt-in to additional password authentication. - */ - String getPasswordProtectionString(); - } - - /** - * The callback to be triggered on success or failure of the password authentication. - */ - public static class PasswordAuthenticationCallback { - private long mNativePtr; - - @CalledByNative("PasswordAuthenticationCallback") - private static PasswordAuthenticationCallback create(long nativePtr) { - return new PasswordAuthenticationCallback(nativePtr); - } - - private PasswordAuthenticationCallback(long nativePtr) { - mNativePtr = nativePtr; - } - - /** - * Called upon authentication results to allow usage of the password or not. - * @param authenticated Whether the authentication was successful. - */ - public final void onResult(boolean authenticated) { - if (mNativePtr == 0) { - assert false : "Can not call onResult more than once per callback."; - return; - } - nativeOnResult(mNativePtr, authenticated); - mNativePtr = 0; - } - } - - private static class DefaultPasswordAuthenticationDelegate - implements PasswordAuthenticationDelegate { - @Override - public boolean isPasswordAuthenticationEnabled() { - return false; - } - - @Override - public void requestAuthentication(Tab tab, PasswordAuthenticationCallback callback) { - callback.onResult(true); - } - - @Override - public String getPasswordProtectionString() { - return ""; - } - } - - private static PasswordAuthenticationDelegate sDelegate; - - private PasswordAuthenticationManager() {} - - private static PasswordAuthenticationDelegate getDelegate() { - if (sDelegate == null) { - sDelegate = new DefaultPasswordAuthenticationDelegate(); - } - return sDelegate; - } - - /** - * Sets the password authentication delegate to be used. - */ - public static void setDelegate(PasswordAuthenticationDelegate delegate) { - sDelegate = delegate; - } - - /** - * @return Whether password authentication is enabled. - */ - public static boolean isPasswordAuthenticationEnabled() { - return getDelegate().isPasswordAuthenticationEnabled(); - } - - /** - * Requests password authentication be presented for the given tab. - * @param tab The tab containing the protected password. - * @param callback The callback to be triggered on authentication result. - */ - @CalledByNative - public static void requestAuthentication( - Tab tab, PasswordAuthenticationCallback callback) { - getDelegate().requestAuthentication(tab, callback); - } - - /** - * @return The message to be displayed in the save password infobar that will allow the user - * to opt-in to additional password authentication. - */ - public static String getPasswordProtectionString() { - return getDelegate().getPasswordProtectionString(); - } - - private static native void nativeOnResult(long callbackPtr, boolean authenticated); -} diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 91dd5fd6eabc..789702d2b569 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -1731,7 +1731,6 @@ 'android/java/src/org/chromium/chrome/browser/omnibox/OmniboxViewUtil.java', 'android/java/src/org/chromium/chrome/browser/partnerbookmarks/PartnerBookmarksReader.java', 'android/java/src/org/chromium/chrome/browser/password_manager/Credential.java', - 'android/java/src/org/chromium/chrome/browser/password_manager/PasswordAuthenticationManager.java', 'android/java/src/org/chromium/chrome/browser/policy/PolicyManager.java', 'android/java/src/org/chromium/chrome/browser/PasswordUIView.java', 'android/java/src/org/chromium/chrome/browser/precache/PrecacheLauncher.java', -- 2.11.4.GIT