Chromium Code Reviews| 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..2872e4dadba2c01cdb4315f1f40eab48d410a18e |
| --- /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 |
| +}; |
|
bbudge
2012/07/07 22:26:22
I get the feeling we'll quickly have more than 32
brettw
2012/07/08 03:24:25
I'm actually more optimistic about this being enou
|
| + |
| +class PPAPI_SHARED_EXPORT PpapiPermissions { |
| + public: |
| + // Initializes the permissions struct with no permissions. |
| + PpapiPermissions(); |
| + |
| + // Initializes with the given permissions bits set. |
| + PpapiPermissions(uint32 perms); |
|
dmichael (off chromium)
2012/07/09 14:41:36
explicit, please
|
| + |
| + ~PpapiPermissions(); |
| + |
| + bool HasPermission(Permission perm) const; |
| + |
| + private: |
| + uint32 permissions_; |
| + |
| + // Note: Copy & assign supported. |
| +}; |
| + |
| +} // namespace ppapi |
| + |
| +#endif // PPAPI_SHARED_IMPL_PPAPI_PERMISSIONS_H_ |