| Index: content/public/android/java/src/org/chromium/content/browser/MediaDrmCredentialManager.java
|
| diff --git a/content/public/android/java/src/org/chromium/content/browser/MediaDrmCredentialManager.java b/content/public/android/java/src/org/chromium/content/browser/MediaDrmCredentialManager.java
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..80cf6fdb57ec0c42cd13d77fb851d21c3d466f08
|
| --- /dev/null
|
| +++ b/content/public/android/java/src/org/chromium/content/browser/MediaDrmCredentialManager.java
|
| @@ -0,0 +1,62 @@
|
| +// 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.content.browser;
|
| +
|
| +import org.chromium.base.CalledByNative;
|
| +import org.chromium.base.JNINamespace;
|
| +
|
| +/**
|
| + * A wrapper of the android MediaDrmCredentailManager
|
| + */
|
| +@JNINamespace("content")
|
| +public class MediaDrmCredentialManager {
|
| + int mNativeMediaDrmCredentialManager;
|
| +
|
| + /**
|
| + * Callback interface for getting notified from credential reset.
|
| + */
|
| + public interface MediaDrmCredentialManagerCallback {
|
| + /**
|
| + * This method will be called when credential reset attempt is done.
|
| + * @param succeeded Whether or not if it succeeded.
|
| + */
|
| + @CalledByNative("MediaDrmCredentialManagerCallback")
|
| + public void onCredentialResetFinished(boolean succeeded);
|
| + }
|
| +
|
| + /**
|
| + * Allocates and initializes the C++ side of this class.
|
| + */
|
| + public MediaDrmCredentialManager() {
|
| + mNativeMediaDrmCredentialManager = nativeInit();
|
| + }
|
| +
|
| + /**
|
| + * Clean up the C++ side of this class. After the call, this class instance shouldn't be used.
|
| + */
|
| + public void destroy() {
|
| + nativeDestroy(mNativeMediaDrmCredentialManager);
|
| + mNativeMediaDrmCredentialManager = 0;
|
| + }
|
| +
|
| + @Override
|
| + protected void finalize() {
|
| + assert mNativeMediaDrmCredentialManager == 0;
|
| + }
|
| +
|
| + /**
|
| + * Attempts to reset the DRM credentials.
|
| + * @param callback It notifies whether or not it succeeded.
|
| + */
|
| + public void ResetCredentials(MediaDrmCredentialManagerCallback callback) {
|
| + assert mNativeMediaDrmCredentialManager != 0;
|
| + nativeResetCredentials(mNativeMediaDrmCredentialManager, callback);
|
| + }
|
| +
|
| + private static native int nativeInit();
|
| + private static native void nativeDestroy(int nativeMediaDrmCredentialManager);
|
| + private static native void nativeResetCredentials(int nativeMediaDrmCredentialManager,
|
| + MediaDrmCredentialManagerCallback callback);
|
| +}
|
|
|