Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
handle permission requests for multiple permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
bridiver committed Sep 11, 2017
1 parent 38c1a25 commit bffa754
Show file tree
Hide file tree
Showing 13 changed files with 106 additions and 435 deletions.
2 changes: 0 additions & 2 deletions atom/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ source_set("browser") {
"atom_download_manager_delegate.h",
"atom_browser_main_parts.cc",
"atom_browser_main_parts.h",
"atom_permission_manager.cc",
"atom_permission_manager.h",
"atom_quota_permission_context.cc",
"atom_quota_permission_context.h",
"atom_resource_dispatcher_host_delegate.cc",
Expand Down
7 changes: 0 additions & 7 deletions atom/browser/atom_browser_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "atom/browser/api/atom_api_protocol.h"
#include "atom/browser/atom_browser_main_parts.h"
#include "atom/browser/atom_download_manager_delegate.h"
#include "atom/browser/atom_permission_manager.h"
#include "atom/browser/browser.h"
#include "atom/browser/net/asar/asar_protocol_handler.h"
#include "atom/browser/net/atom_cert_verifier.h"
Expand Down Expand Up @@ -137,12 +136,6 @@ AtomBrowserContext::GetDownloadManagerDelegate() {
return download_manager_delegate_.get();
}

content::PermissionManager* AtomBrowserContext::GetPermissionManager() {
if (!permission_manager_.get())
permission_manager_.reset(new AtomPermissionManager);
return permission_manager_.get();
}

std::unique_ptr<net::CertVerifier> AtomBrowserContext::CreateCertVerifier() {
return base::WrapUnique(new AtomCertVerifier);
}
Expand Down
3 changes: 0 additions & 3 deletions atom/browser/atom_browser_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
namespace atom {

class AtomDownloadManagerDelegate;
class AtomPermissionManager;

class AtomBrowserContext : public brightray::BrowserContext {
public:
Expand All @@ -38,7 +37,6 @@ class AtomBrowserContext : public brightray::BrowserContext {

// content::BrowserContext:
content::DownloadManagerDelegate* GetDownloadManagerDelegate() override;
content::PermissionManager* GetPermissionManager() override;

// brightray::BrowserContext:
void RegisterPrefs(PrefRegistrySimple* pref_registry) override;
Expand All @@ -53,7 +51,6 @@ class AtomBrowserContext : public brightray::BrowserContext {

private:
std::unique_ptr<AtomDownloadManagerDelegate> download_manager_delegate_;
std::unique_ptr<AtomPermissionManager> permission_manager_;
bool use_cache_;

// Managed by brightray::BrowserContext.
Expand Down
148 changes: 0 additions & 148 deletions atom/browser/atom_permission_manager.cc

This file was deleted.

91 changes: 0 additions & 91 deletions atom/browser/atom_permission_manager.h

This file was deleted.

4 changes: 2 additions & 2 deletions atom/browser/web_contents_permission_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <string>

#include "atom/browser/atom_permission_manager.h"
#include "brave/browser/brave_permission_manager.h"
#include "brightray/browser/media/media_stream_devices_controller.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/render_process_host.h"
Expand Down Expand Up @@ -57,7 +57,7 @@ void WebContentsPermissionHelper::RequestPermission(
const base::Callback<void(bool)>& callback,
const GURL& security_origin, bool user_gesture) {
auto rfh = web_contents_->GetMainFrame();
auto permission_manager = static_cast<AtomPermissionManager*>(
auto permission_manager = static_cast<brave::BravePermissionManager*>(
web_contents_->GetBrowserContext()->GetPermissionManager());
GURL origin;
if (security_origin.is_empty()) {
Expand Down
Loading

0 comments on commit bffa754

Please sign in to comment.