permission_manager.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // Copyright (c) 2015 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-CHROMIUM file.
  4. #ifndef BRIGHTRAY_BROWSER_PERMISSION_MANAGER_H_
  5. #define BRIGHTRAY_BROWSER_PERMISSION_MANAGER_H_
  6. #include <vector>
  7. #include "base/callback_forward.h"
  8. #include "base/macros.h"
  9. #include "content/public/browser/permission_manager.h"
  10. namespace brightray {
  11. class PermissionManager : public content::PermissionManager {
  12. public:
  13. PermissionManager();
  14. ~PermissionManager() override;
  15. // content::PermissionManager:
  16. int RequestPermission(
  17. content::PermissionType permission,
  18. content::RenderFrameHost* render_frame_host,
  19. const GURL& requesting_origin,
  20. bool user_gesture,
  21. const base::Callback<void(blink::mojom::PermissionStatus)>& callback)
  22. override;
  23. int RequestPermissions(
  24. const std::vector<content::PermissionType>& permissions,
  25. content::RenderFrameHost* render_frame_host,
  26. const GURL& requesting_origin,
  27. bool user_gesture,
  28. const base::Callback<
  29. void(const std::vector<blink::mojom::PermissionStatus>&)>& callback)
  30. override;
  31. void CancelPermissionRequest(int request_id) override;
  32. void ResetPermission(content::PermissionType permission,
  33. const GURL& requesting_origin,
  34. const GURL& embedding_origin) override;
  35. blink::mojom::PermissionStatus GetPermissionStatus(
  36. content::PermissionType permission,
  37. const GURL& requesting_origin,
  38. const GURL& embedding_origin) override;
  39. int SubscribePermissionStatusChange(
  40. content::PermissionType permission,
  41. const GURL& requesting_origin,
  42. const GURL& embedding_origin,
  43. const base::Callback<void(blink::mojom::PermissionStatus)>& callback)
  44. override;
  45. void UnsubscribePermissionStatusChange(int subscription_id) override;
  46. private:
  47. DISALLOW_COPY_AND_ASSIGN(PermissionManager);
  48. };
  49. } // namespace brightray
  50. #endif // BRIGHTRAY_BROWSER_PERMISSION_MANAGER_H_