#ifndef CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_DRM_CREDENTIAL_MANAGER_H_
#define CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_DRM_CREDENTIAL_MANAGER_H_
#include <jni.h>
#include <string>
#include "base/callback.h"
#include "base/memory/singleton.h"
#include "media/base/android/media_drm_bridge.h"
namespace content {
class MediaDrmCredentialManager {
public:
static MediaDrmCredentialManager* GetInstance();
typedef base::Callback<void(bool)> ResetCredentialsCB;
static void ResetCredentials(JNIEnv* env, jclass clazz, jobject callback);
void ResetCredentials(const ResetCredentialsCB& reset_credentials_cb);
static bool RegisterMediaDrmCredentialManager(JNIEnv* env);
private:
friend struct DefaultSingletonTraits<MediaDrmCredentialManager>;
friend class Singleton<MediaDrmCredentialManager>;
typedef media::MediaDrmBridge::SecurityLevel SecurityLevel;
MediaDrmCredentialManager();
~MediaDrmCredentialManager();
void OnResetCredentialsCompleted(SecurityLevel security_level, bool success);
bool ResetCredentialsInternal(SecurityLevel security_level);
scoped_ptr<media::MediaDrmBridge> media_drm_bridge_;
ResetCredentialsCB reset_credentials_cb_;
DISALLOW_COPY_AND_ASSIGN(MediaDrmCredentialManager);
};
}
#endif