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

Unified Diff: ppapi/shared_impl/ppapi_permissions.h

Issue 10735011: Add permissions buts for Pepper plugins. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | « ppapi/ppapi_shared.gypi ('k') | ppapi/shared_impl/ppapi_permissions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/ppapi_permissions.h
diff --git a/ppapi/shared_impl/ppapi_permissions.h b/ppapi/shared_impl/ppapi_permissions.h
new file mode 100644
index 0000000000000000000000000000000000000000..3caa65d0e487e9268cafff4ab93dac0be2b0ff5b
--- /dev/null
+++ b/ppapi/shared_impl/ppapi_permissions.h
@@ -0,0 +1,45 @@
+// Copyright (c) 2012 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 PPAPI_SHARED_IMPL_PPAPI_PERMISSIONS_H_
+#define PPAPI_SHARED_IMPL_PPAPI_PERMISSIONS_H_
+
+#include "base/basictypes.h"
+#include "ppapi/shared_impl/ppapi_shared_export.h"
+
+namespace ppapi {
+
+enum Permission {
+ // Allows access to dev interfaces.
+ PERMISSION_DEV = 1 << 0,
+
+ // Allows access to Browser-internal interfaces.
+ PERMISSION_PRIVATE = 1 << 2,
+
+ // Allows ability to bypass user-gesture checks for showing things like
+ // file select dialogs.
+ PERMISSION_BYPASS_USER_GESTURE = 1 << 3
+};
+
+class PPAPI_SHARED_EXPORT PpapiPermissions {
+ public:
+ // Initializes the permissions struct with no permissions.
+ PpapiPermissions();
+
+ // Initializes with the given permissions bits set.
+ explicit PpapiPermissions(uint32 perms);
+
+ ~PpapiPermissions();
+
+ bool HasPermission(Permission perm) const;
+
+ private:
+ uint32 permissions_;
+
+ // Note: Copy & assign supported.
+};
+
+} // namespace ppapi
+
+#endif // PPAPI_SHARED_IMPL_PPAPI_PERMISSIONS_H_
« no previous file with comments | « ppapi/ppapi_shared.gypi ('k') | ppapi/shared_impl/ppapi_permissions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698