| // Copyright 2015 The Chromium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #ifndef CHROMECAST_BROWSER_CAST_PERMISSION_MANAGER_H_ |
| #define CHROMECAST_BROWSER_CAST_PERMISSION_MANAGER_H_ |
| |
| #include "base/functional/callback_forward.h" |
| #include "content/public/browser/permission_controller_delegate.h" |
| #include "content/public/browser/permission_result.h" |
| #include "third_party/blink/public/common/permissions/permission_utils.h" |
| #include "url/gurl.h" |
| |
| namespace blink { |
| enum class PermissionType; |
| } |
| |
| namespace chromecast { |
| namespace shell { |
| |
| class CastPermissionManager : public content::PermissionControllerDelegate { |
| public: |
| CastPermissionManager(); |
| |
| CastPermissionManager(const CastPermissionManager&) = delete; |
| CastPermissionManager& operator=(const CastPermissionManager&) = delete; |
| |
| ~CastPermissionManager() override; |
| |
| // content::PermissionControllerDelegate implementation: |
| void RequestPermissions( |
| content::RenderFrameHost* render_frame_host, |
| const content::PermissionRequestDescription& request_description, |
| base::OnceCallback<void(const std::vector<content::PermissionResult>&)> |
| callback) override; |
| void ResetPermission(blink::PermissionType permission, |
| const GURL& requesting_origin, |
| const GURL& embedding_origin) override; |
| void RequestPermissionsFromCurrentDocument( |
| content::RenderFrameHost* render_frame_host, |
| const content::PermissionRequestDescription& request_description, |
| base::OnceCallback<void(const std::vector<content::PermissionResult>&)> |
| callback) override; |
| blink::mojom::PermissionStatus GetPermissionStatus( |
| const blink::mojom::PermissionDescriptorPtr& permission, |
| const GURL& requesting_origin, |
| const GURL& embedding_origin) override; |
| content::PermissionResult GetPermissionResultForOriginWithoutContext( |
| const blink::mojom::PermissionDescriptorPtr& permission_descriptor, |
| const url::Origin& requesting_origin, |
| const url::Origin& embedding_origin) override; |
| blink::mojom::PermissionStatus GetPermissionStatusForCurrentDocument( |
| const blink::mojom::PermissionDescriptorPtr& permission_descriptor, |
| content::RenderFrameHost* render_frame_host, |
| bool should_include_device_status) override; |
| blink::mojom::PermissionStatus GetPermissionStatusForWorker( |
| const blink::mojom::PermissionDescriptorPtr& permission_descriptor, |
| content::RenderProcessHost* render_process_host, |
| const GURL& worker_origin) override; |
| blink::mojom::PermissionStatus GetPermissionStatusForEmbeddedRequester( |
| const blink::mojom::PermissionDescriptorPtr& permission_descriptor, |
| content::RenderFrameHost* render_frame_host, |
| const url::Origin& requesting_origin) override; |
| }; |
| |
| } // namespace shell |
| } // namespace chromecast |
| |
| #endif // CHROMECAST_BROWSER_CAST_PERMISSION_MANAGER_H_ |