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.
|
|
|
|
|
|
|
|
#include "browser/permission_manager.h"
|
|
|
|
|
|
|
|
#include "base/callback.h"
|
2015-09-05 05:50:47 +00:00
|
|
|
#include "content/public/browser/child_process_security_policy.h"
|
2015-05-22 06:50:41 +00:00
|
|
|
#include "content/public/browser/permission_type.h"
|
2015-09-05 05:50:47 +00:00
|
|
|
#include "content/public/browser/render_frame_host.h"
|
|
|
|
#include "content/public/browser/render_process_host.h"
|
2015-05-22 06:50:41 +00:00
|
|
|
|
|
|
|
namespace brightray {
|
|
|
|
|
|
|
|
PermissionManager::PermissionManager() {
|
|
|
|
}
|
|
|
|
|
|
|
|
PermissionManager::~PermissionManager() {
|
|
|
|
}
|
|
|
|
|
|
|
|
void PermissionManager::RequestPermission(
|
|
|
|
content::PermissionType permission,
|
2015-09-02 07:16:34 +00:00
|
|
|
content::RenderFrameHost* render_frame_host,
|
2015-05-22 06:50:41 +00:00
|
|
|
int request_id,
|
|
|
|
const GURL& requesting_origin,
|
|
|
|
bool user_gesture,
|
|
|
|
const base::Callback<void(content::PermissionStatus)>& callback) {
|
2015-09-05 05:50:47 +00:00
|
|
|
if (permission == content::PermissionType::MIDI_SYSEX) {
|
|
|
|
content::ChildProcessSecurityPolicy::GetInstance()->
|
|
|
|
GrantSendMidiSysExMessage(render_frame_host->GetProcess()->GetID());
|
|
|
|
}
|
2015-05-22 06:50:41 +00:00
|
|
|
callback.Run(content::PERMISSION_STATUS_GRANTED);
|
|
|
|
}
|
|
|
|
|
|
|
|
void PermissionManager::CancelPermissionRequest(
|
|
|
|
content::PermissionType permission,
|
2015-09-02 07:16:34 +00:00
|
|
|
content::RenderFrameHost* render_frame_host,
|
2015-05-22 06:50:41 +00:00
|
|
|
int request_id,
|
|
|
|
const GURL& requesting_origin) {
|
|
|
|
}
|
|
|
|
|
|
|
|
void PermissionManager::ResetPermission(
|
|
|
|
content::PermissionType permission,
|
|
|
|
const GURL& requesting_origin,
|
|
|
|
const GURL& embedding_origin) {
|
|
|
|
}
|
|
|
|
|
|
|
|
content::PermissionStatus PermissionManager::GetPermissionStatus(
|
|
|
|
content::PermissionType permission,
|
|
|
|
const GURL& requesting_origin,
|
|
|
|
const GURL& embedding_origin) {
|
|
|
|
return content::PERMISSION_STATUS_GRANTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
void PermissionManager::RegisterPermissionUsage(
|
|
|
|
content::PermissionType permission,
|
|
|
|
const GURL& requesting_origin,
|
|
|
|
const GURL& embedding_origin) {
|
|
|
|
}
|
|
|
|
|
|
|
|
int PermissionManager::SubscribePermissionStatusChange(
|
|
|
|
content::PermissionType permission,
|
|
|
|
const GURL& requesting_origin,
|
|
|
|
const GURL& embedding_origin,
|
|
|
|
const base::Callback<void(content::PermissionStatus)>& callback) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void PermissionManager::UnsubscribePermissionStatusChange(int subscription_id) {
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace brightray
|