OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/permissions/chooser_permission_manager.h" |
| 6 |
| 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/ui/bluetooth/bluetooth_permission_context.h" |
| 9 #include "chrome/browser/ui/bluetooth/bluetooth_permission_context_factory.h" |
| 10 |
| 11 ChooserPermissionManager::ChooserPermissionManager(Profile* profile) |
| 12 : profile_(profile) {} |
| 13 |
| 14 ChooserPermissionManager::~ChooserPermissionManager() {} |
| 15 |
| 16 void ChooserPermissionManager::GrantPermission(const GURL& requesting_origin, |
| 17 const GURL& embedding_origin, |
| 18 const std::string& id) { |
| 19 BluetoothPermissionContext* permission_context = |
| 20 BluetoothPermissionContextFactory::GetForProfile(profile_); |
| 21 permission_context->GrantDevicePermission(requesting_origin, embedding_origin, |
| 22 id); |
| 23 } |
| 24 |
| 25 void ChooserPermissionManager::RevokePermission(const GURL& requesting_origin, |
| 26 const GURL& embedding_origin, |
| 27 const std::string& id) { |
| 28 BluetoothPermissionContext* permission_context = |
| 29 BluetoothPermissionContextFactory::GetForProfile(profile_); |
| 30 permission_context->RevokeDevicePermission(requesting_origin, |
| 31 embedding_origin, id); |
| 32 } |
OLD | NEW |