permission_result.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // Copyright 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_PERMISSIONS_PERMISSION_RESULT_H_
  5. #define COMPONENTS_PERMISSIONS_PERMISSION_RESULT_H_
  6. #include "components/content_settings/core/common/content_settings.h"
  7. namespace permissions {
  8. // Identifies the source or reason for a permission status being returned.
  9. enum class PermissionStatusSource {
  10. // The reason for the status is not specified.
  11. UNSPECIFIED,
  12. // The status is the result of being blocked by the permissions kill switch.
  13. KILL_SWITCH,
  14. // The status is the result of being blocked due to the user dismissing a
  15. // permission prompt multiple times.
  16. MULTIPLE_DISMISSALS,
  17. // The status is the result of being blocked due to the user ignoring a
  18. // permission prompt multiple times.
  19. MULTIPLE_IGNORES,
  20. // This origin is insecure, thus its access to some permissions has been
  21. // restricted, such as camera, microphone, etc.
  22. INSECURE_ORIGIN,
  23. // The feature has been blocked in the requesting frame by permissions policy.
  24. FEATURE_POLICY,
  25. // The virtual URL and the loaded URL are for different origins. The loaded
  26. // URL is the one actually in the renderer, but the virtual URL is the one
  27. // seen by the user. This may be very confusing for a user to see in a
  28. // permissions request.
  29. VIRTUAL_URL_DIFFERENT_ORIGIN,
  30. // The status is the result of a permission being requested inside a portal.
  31. // Permissions are currently always denied inside a portal.
  32. PORTAL,
  33. // The status is the result of a permission being requested inside a fenced
  34. // frame. Permissions are currently always denied inside a fenced frame.
  35. FENCED_FRAME,
  36. };
  37. struct PermissionResult {
  38. PermissionResult(ContentSetting content_setting,
  39. PermissionStatusSource source);
  40. ~PermissionResult();
  41. ContentSetting content_setting;
  42. PermissionStatusSource source;
  43. };
  44. } // namespace permissions
  45. #endif // COMPONENTS_PERMISSIONS_PERMISSION_RESULT_H_