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

Unified Diff: media/base/media_permission.h

Issue 871663003: media: Add MediaPermission interface and MediaPermissionDispatcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 5 years, 11 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 | « media/base/BUILD.gn ('k') | media/base/media_permission.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/media_permission.h
diff --git a/media/base/media_permission.h b/media/base/media_permission.h
new file mode 100644
index 0000000000000000000000000000000000000000..760ba0caa9f3fe1a2f676acb35c17926c6b611b2
--- /dev/null
+++ b/media/base/media_permission.h
@@ -0,0 +1,49 @@
+// Copyright 2015 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.
+
+#ifndef MEDIA_BASE_MEDIA_PERMISSION_H_
+#define MEDIA_BASE_MEDIA_PERMISSION_H_
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "media/base/media_export.h"
+
+class GURL;
+
+namespace media {
+
+// Interface to handle media related permission checks and requests.
+class MEDIA_EXPORT MediaPermission {
+ public:
+ typedef base::Callback<void(bool)> PermissionStatusCB;
+
+ enum Type {
+ PROTECTED_MEDIA_IDENTIFIER,
+ };
+
+ MediaPermission();
+ virtual ~MediaPermission();
+
+ // Checks whether |type| is permitted for |security_origion| without
+ // triggering user interaction (e.g. permission prompt). The status will be
+ // |false| if the permission has never been set.
+ virtual void HasPermission(
+ Type type,
+ const GURL& security_origin,
+ const PermissionStatusCB& permission_status_cb) = 0;
+
+ // Requests |type| permission for |security_origion|. This may trigger user
+ // interaction (e.g. permission prompt) if the permission has never been set.
+ virtual void RequestPermission(
+ Type type,
+ const GURL& security_origin,
+ const PermissionStatusCB& permission_status_cb) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MediaPermission);
+};
+
+} // namespace media
+
+#endif // MEDIA_BASE_MEDIA_PERMISSION_H_
« no previous file with comments | « media/base/BUILD.gn ('k') | media/base/media_permission.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698