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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/password_manager/PasswordAuthenticationManager.java

Issue 1155273004: Remove PasswordAuthenticationManager.java file that is no longer used. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 7 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 | « AUTHORS ('k') | chrome/chrome_browser.gypi » ('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/password_manager/PasswordAuthenticationManager.java
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 78e7eb345d7bc5797d87818fb2ee74d554b41192..0000000000000000000000000000000000000000
--- 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);
-}
« no previous file with comments | « AUTHORS ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698