2015-05-22 06:50:41 +00:00
|
|
|
// Copyright (c) 2015 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-CHROMIUM file.
|
|
|
|
|
2017-05-18 22:05:25 +00:00
|
|
|
#ifndef BRIGHTRAY_BROWSER_PERMISSION_MANAGER_H_
|
|
|
|
#define BRIGHTRAY_BROWSER_PERMISSION_MANAGER_H_
|
2015-05-22 06:50:41 +00:00
|
|
|
|
2017-05-18 22:06:57 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2015-05-22 06:50:41 +00:00
|
|
|
#include "base/callback_forward.h"
|
|
|
|
#include "base/macros.h"
|
|
|
|
#include "content/public/browser/permission_manager.h"
|
|
|
|
|
|
|
|
namespace brightray {
|
|
|
|
|
|
|
|
class PermissionManager : public content::PermissionManager {
|
|
|
|
public:
|
|
|
|
PermissionManager();
|
|
|
|
~PermissionManager() override;
|
|
|
|
|
|
|
|
// content::PermissionManager:
|
2015-12-07 11:55:01 +00:00
|
|
|
int RequestPermission(
|
2015-05-22 06:50:41 +00:00
|
|
|
content::PermissionType permission,
|
2015-09-02 07:16:34 +00:00
|
|
|
content::RenderFrameHost* render_frame_host,
|
2015-05-22 06:50:41 +00:00
|
|
|
const GURL& requesting_origin,
|
2017-01-13 08:52:45 +00:00
|
|
|
bool user_gesture,
|
2017-03-23 22:47:30 +00:00
|
|
|
const base::Callback<void(blink::mojom::PermissionStatus)>& callback)
|
|
|
|
override;
|
2016-03-08 07:09:25 +00:00
|
|
|
int RequestPermissions(
|
|
|
|
const std::vector<content::PermissionType>& permissions,
|
|
|
|
content::RenderFrameHost* render_frame_host,
|
|
|
|
const GURL& requesting_origin,
|
2017-01-13 08:52:45 +00:00
|
|
|
bool user_gesture,
|
2017-03-23 22:47:30 +00:00
|
|
|
const base::Callback<
|
|
|
|
void(const std::vector<blink::mojom::PermissionStatus>&)>& callback)
|
|
|
|
override;
|
2015-12-07 11:55:01 +00:00
|
|
|
void CancelPermissionRequest(int request_id) override;
|
2015-05-22 06:50:41 +00:00
|
|
|
void ResetPermission(content::PermissionType permission,
|
|
|
|
const GURL& requesting_origin,
|
|
|
|
const GURL& embedding_origin) override;
|
2016-05-23 01:59:07 +00:00
|
|
|
blink::mojom::PermissionStatus GetPermissionStatus(
|
2015-05-22 06:50:41 +00:00
|
|
|
content::PermissionType permission,
|
|
|
|
const GURL& requesting_origin,
|
|
|
|
const GURL& embedding_origin) override;
|
|
|
|
int SubscribePermissionStatusChange(
|
|
|
|
content::PermissionType permission,
|
|
|
|
const GURL& requesting_origin,
|
|
|
|
const GURL& embedding_origin,
|
2017-03-23 22:47:30 +00:00
|
|
|
const base::Callback<void(blink::mojom::PermissionStatus)>& callback)
|
|
|
|
override;
|
2015-05-22 06:50:41 +00:00
|
|
|
void UnsubscribePermissionStatusChange(int subscription_id) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(PermissionManager);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace brightray
|
|
|
|
|
2017-05-18 22:05:25 +00:00
|
|
|
#endif // BRIGHTRAY_BROWSER_PERMISSION_MANAGER_H_
|