#ifndef CHROME_BROWSER_MEDIA_PROTECTED_MEDIA_IDENTIFIER_PERMISSION_CONTEXT_H_
#define CHROME_BROWSER_MEDIA_PROTECTED_MEDIA_IDENTIFIER_PERMISSION_CONTEXT_H_
#include <map>
#include <string>
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/content_settings/permission_queue_controller.h"
class PermissionRequestID;
class Profile;
namespace content {
class RenderViewHost;
}
class ProtectedMediaIdentifierPermissionContext
: public base::RefCountedThreadSafe<
ProtectedMediaIdentifierPermissionContext> {
public:
explicit ProtectedMediaIdentifierPermissionContext(Profile* profile);
void RequestProtectedMediaIdentifierPermission(
int render_process_id,
int render_view_id,
int bridge_id,
int group_id,
const GURL& requesting_frame,
const base::Callback<void(bool)>& callback);
void CancelProtectedMediaIdentifierPermissionRequests(
int group_id);
void ShutdownOnUIThread();
private:
friend class base::RefCountedThreadSafe<
ProtectedMediaIdentifierPermissionContext>;
~ProtectedMediaIdentifierPermissionContext();
Profile* profile() const { return profile_; }
PermissionQueueController* QueueController();
void NotifyPermissionSet(const PermissionRequestID& id,
const GURL& requesting_frame,
const base::Callback<void(bool)>& callback,
bool allowed);
void DecidePermission(const PermissionRequestID& id,
const GURL& requesting_frame,
const GURL& embedder,
content::RenderViewHost* rvh,
const base::Callback<void(bool)>& callback);
void PermissionDecided(const PermissionRequestID& id,
const GURL& requesting_frame,
const GURL& embedder,
const base::Callback<void(bool)>& callback,
bool allowed);
PermissionQueueController* CreateQueueController();
void CancelPendingInfobarRequests(int group_id);
Profile* const profile_;
bool shutting_down_;
scoped_ptr<PermissionQueueController> permission_queue_controller_;
DISALLOW_COPY_AND_ASSIGN(ProtectedMediaIdentifierPermissionContext);
};
#endif