Remove Permission manager from brightray
Electron manages its own implementation, this was missed out when merging the brightray/ component.
This commit is contained in:
parent
f6665edc73
commit
01fdfc4574
5 changed files with 0 additions and 151 deletions
|
@ -194,12 +194,6 @@ content::SSLHostStateDelegate* BrowserContext::GetSSLHostStateDelegate() {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
content::PermissionManager* BrowserContext::GetPermissionManager() {
|
|
||||||
if (!permission_manager_.get())
|
|
||||||
permission_manager_.reset(new PermissionManager);
|
|
||||||
return permission_manager_.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
content::BackgroundFetchDelegate* BrowserContext::GetBackgroundFetchDelegate() {
|
content::BackgroundFetchDelegate* BrowserContext::GetBackgroundFetchDelegate() {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
#include "base/memory/ref_counted.h"
|
#include "base/memory/ref_counted.h"
|
||||||
#include "base/memory/weak_ptr.h"
|
#include "base/memory/weak_ptr.h"
|
||||||
#include "brightray/browser/media/media_device_id_salt.h"
|
#include "brightray/browser/media/media_device_id_salt.h"
|
||||||
#include "brightray/browser/permission_manager.h"
|
|
||||||
#include "brightray/browser/url_request_context_getter.h"
|
#include "brightray/browser/url_request_context_getter.h"
|
||||||
#include "content/public/browser/browser_context.h"
|
#include "content/public/browser/browser_context.h"
|
||||||
|
|
||||||
|
@ -24,8 +23,6 @@ class SpecialStoragePolicy;
|
||||||
|
|
||||||
namespace brightray {
|
namespace brightray {
|
||||||
|
|
||||||
class PermissionManager;
|
|
||||||
|
|
||||||
class BrowserContext : public base::RefCounted<BrowserContext>,
|
class BrowserContext : public base::RefCounted<BrowserContext>,
|
||||||
public content::BrowserContext,
|
public content::BrowserContext,
|
||||||
public brightray::URLRequestContextGetter::Delegate {
|
public brightray::URLRequestContextGetter::Delegate {
|
||||||
|
@ -52,7 +49,6 @@ class BrowserContext : public base::RefCounted<BrowserContext>,
|
||||||
storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override;
|
storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override;
|
||||||
content::PushMessagingService* GetPushMessagingService() override;
|
content::PushMessagingService* GetPushMessagingService() override;
|
||||||
content::SSLHostStateDelegate* GetSSLHostStateDelegate() override;
|
content::SSLHostStateDelegate* GetSSLHostStateDelegate() override;
|
||||||
content::PermissionManager* GetPermissionManager() override;
|
|
||||||
content::BackgroundFetchDelegate* GetBackgroundFetchDelegate() override;
|
content::BackgroundFetchDelegate* GetBackgroundFetchDelegate() override;
|
||||||
content::BackgroundSyncController* GetBackgroundSyncController() override;
|
content::BackgroundSyncController* GetBackgroundSyncController() override;
|
||||||
content::BrowsingDataRemoverDelegate* GetBrowsingDataRemoverDelegate()
|
content::BrowsingDataRemoverDelegate* GetBrowsingDataRemoverDelegate()
|
||||||
|
@ -125,7 +121,6 @@ class BrowserContext : public base::RefCounted<BrowserContext>,
|
||||||
scoped_refptr<URLRequestContextGetter> url_request_getter_;
|
scoped_refptr<URLRequestContextGetter> url_request_getter_;
|
||||||
scoped_refptr<storage::SpecialStoragePolicy> storage_policy_;
|
scoped_refptr<storage::SpecialStoragePolicy> storage_policy_;
|
||||||
std::unique_ptr<PrefService> prefs_;
|
std::unique_ptr<PrefService> prefs_;
|
||||||
std::unique_ptr<PermissionManager> permission_manager_;
|
|
||||||
std::unique_ptr<MediaDeviceIDSalt> media_device_id_salt_;
|
std::unique_ptr<MediaDeviceIDSalt> media_device_id_salt_;
|
||||||
|
|
||||||
base::WeakPtrFactory<BrowserContext> weak_factory_;
|
base::WeakPtrFactory<BrowserContext> weak_factory_;
|
||||||
|
|
|
@ -1,79 +0,0 @@
|
||||||
// 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.
|
|
||||||
|
|
||||||
#include "brightray/browser/permission_manager.h"
|
|
||||||
|
|
||||||
#include "base/callback.h"
|
|
||||||
#include "content/public/browser/child_process_security_policy.h"
|
|
||||||
#include "content/public/browser/permission_type.h"
|
|
||||||
#include "content/public/browser/render_frame_host.h"
|
|
||||||
#include "content/public/browser/render_process_host.h"
|
|
||||||
|
|
||||||
namespace brightray {
|
|
||||||
|
|
||||||
PermissionManager::PermissionManager() {}
|
|
||||||
|
|
||||||
PermissionManager::~PermissionManager() {}
|
|
||||||
|
|
||||||
int PermissionManager::RequestPermission(
|
|
||||||
content::PermissionType permission,
|
|
||||||
content::RenderFrameHost* render_frame_host,
|
|
||||||
const GURL& requesting_origin,
|
|
||||||
bool user_gesture,
|
|
||||||
const base::Callback<void(blink::mojom::PermissionStatus)>& callback) {
|
|
||||||
if (permission == content::PermissionType::MIDI_SYSEX) {
|
|
||||||
content::ChildProcessSecurityPolicy::GetInstance()
|
|
||||||
->GrantSendMidiSysExMessage(render_frame_host->GetProcess()->GetID());
|
|
||||||
}
|
|
||||||
callback.Run(blink::mojom::PermissionStatus::GRANTED);
|
|
||||||
return kNoPendingOperation;
|
|
||||||
}
|
|
||||||
|
|
||||||
int PermissionManager::RequestPermissions(
|
|
||||||
const std::vector<content::PermissionType>& permissions,
|
|
||||||
content::RenderFrameHost* render_frame_host,
|
|
||||||
const GURL& requesting_origin,
|
|
||||||
bool user_gesture,
|
|
||||||
const base::Callback<
|
|
||||||
void(const std::vector<blink::mojom::PermissionStatus>&)>& callback) {
|
|
||||||
std::vector<blink::mojom::PermissionStatus> permissionStatuses;
|
|
||||||
|
|
||||||
for (auto permission : permissions) {
|
|
||||||
if (permission == content::PermissionType::MIDI_SYSEX) {
|
|
||||||
content::ChildProcessSecurityPolicy::GetInstance()
|
|
||||||
->GrantSendMidiSysExMessage(render_frame_host->GetProcess()->GetID());
|
|
||||||
}
|
|
||||||
|
|
||||||
permissionStatuses.push_back(blink::mojom::PermissionStatus::GRANTED);
|
|
||||||
}
|
|
||||||
|
|
||||||
callback.Run(permissionStatuses);
|
|
||||||
return kNoPendingOperation;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PermissionManager::CancelPermissionRequest(int request_id) {}
|
|
||||||
|
|
||||||
void PermissionManager::ResetPermission(content::PermissionType permission,
|
|
||||||
const GURL& requesting_origin,
|
|
||||||
const GURL& embedding_origin) {}
|
|
||||||
|
|
||||||
blink::mojom::PermissionStatus PermissionManager::GetPermissionStatus(
|
|
||||||
content::PermissionType permission,
|
|
||||||
const GURL& requesting_origin,
|
|
||||||
const GURL& embedding_origin) {
|
|
||||||
return blink::mojom::PermissionStatus::GRANTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
int PermissionManager::SubscribePermissionStatusChange(
|
|
||||||
content::PermissionType permission,
|
|
||||||
const GURL& requesting_origin,
|
|
||||||
const GURL& embedding_origin,
|
|
||||||
const base::Callback<void(blink::mojom::PermissionStatus)>& callback) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PermissionManager::UnsubscribePermissionStatusChange(int subscription_id) {
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace brightray
|
|
|
@ -1,59 +0,0 @@
|
||||||
// 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.
|
|
||||||
|
|
||||||
#ifndef BRIGHTRAY_BROWSER_PERMISSION_MANAGER_H_
|
|
||||||
#define BRIGHTRAY_BROWSER_PERMISSION_MANAGER_H_
|
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#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:
|
|
||||||
int RequestPermission(
|
|
||||||
content::PermissionType permission,
|
|
||||||
content::RenderFrameHost* render_frame_host,
|
|
||||||
const GURL& requesting_origin,
|
|
||||||
bool user_gesture,
|
|
||||||
const base::Callback<void(blink::mojom::PermissionStatus)>& callback)
|
|
||||||
override;
|
|
||||||
int RequestPermissions(
|
|
||||||
const std::vector<content::PermissionType>& permissions,
|
|
||||||
content::RenderFrameHost* render_frame_host,
|
|
||||||
const GURL& requesting_origin,
|
|
||||||
bool user_gesture,
|
|
||||||
const base::Callback<
|
|
||||||
void(const std::vector<blink::mojom::PermissionStatus>&)>& callback)
|
|
||||||
override;
|
|
||||||
void CancelPermissionRequest(int request_id) override;
|
|
||||||
void ResetPermission(content::PermissionType permission,
|
|
||||||
const GURL& requesting_origin,
|
|
||||||
const GURL& embedding_origin) override;
|
|
||||||
blink::mojom::PermissionStatus GetPermissionStatus(
|
|
||||||
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,
|
|
||||||
const base::Callback<void(blink::mojom::PermissionStatus)>& callback)
|
|
||||||
override;
|
|
||||||
void UnsubscribePermissionStatusChange(int subscription_id) override;
|
|
||||||
|
|
||||||
private:
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(PermissionManager);
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace brightray
|
|
||||||
|
|
||||||
#endif // BRIGHTRAY_BROWSER_PERMISSION_MANAGER_H_
|
|
|
@ -58,8 +58,6 @@
|
||||||
'browser/notification_presenter.h',
|
'browser/notification_presenter.h',
|
||||||
'browser/notification.cc',
|
'browser/notification.cc',
|
||||||
'browser/notification.h',
|
'browser/notification.h',
|
||||||
'browser/permission_manager.cc',
|
|
||||||
'browser/permission_manager.h',
|
|
||||||
'browser/platform_notification_service.cc',
|
'browser/platform_notification_service.cc',
|
||||||
'browser/platform_notification_service.h',
|
'browser/platform_notification_service.h',
|
||||||
'browser/linux/libnotify_loader.h',
|
'browser/linux/libnotify_loader.h',
|
||||||
|
|
Loading…
Add table
Reference in a new issue