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

Unified Diff: media/filters/default_media_permission.h

Issue 887873003: media: Add DefaultMediaPermission. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase only 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/cdm/proxy_decryptor.cc ('k') | media/filters/default_media_permission.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/default_media_permission.h
diff --git a/media/filters/default_media_permission.h b/media/filters/default_media_permission.h
new file mode 100644
index 0000000000000000000000000000000000000000..9ad295a9c05c9f57491ba94616053716e9aa3338
--- /dev/null
+++ b/media/filters/default_media_permission.h
@@ -0,0 +1,39 @@
+// 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_FILTERS_DEFAULT_MEDIA_PERMISSION_H_
+#define MEDIA_FILTERS_DEFAULT_MEDIA_PERMISSION_H_
+
+#include "media/base/media_export.h"
+#include "media/base/media_permission.h"
+
+namespace media {
+
+// Default MediaPermission implementation that will always allow or deny the
+// permission request/check based on |allow|.
+// WARNING: This class allows or denies permission request/check without real
+// user's consent. It should NOT be used in a real user facing product.
+class MEDIA_EXPORT DefaultMediaPermission : public MediaPermission {
+ public:
+ explicit DefaultMediaPermission(bool allow);
+ ~DefaultMediaPermission() override;
+
+ // media::MediaPermission implementation.
+ void HasPermission(Type type,
+ const GURL& security_origin,
+ const PermissionStatusCB& permission_status_cb) override;
+ void RequestPermission(
+ Type type,
+ const GURL& security_origin,
+ const PermissionStatusCB& permission_status_cb) override;
+
+ private:
+ const bool allow_;
+
+ DISALLOW_COPY_AND_ASSIGN(DefaultMediaPermission);
+};
+
+} // namespace media
+
+#endif // MEDIA_FILTERS_DEFAULT_MEDIA_PERMISSION_H_
« no previous file with comments | « media/cdm/proxy_decryptor.cc ('k') | media/filters/default_media_permission.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698