Chromium Code Reviews| 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( | |
| 17 const url::Origin& requesting_origin, | |
| 18 const url::Origin& embedding_origin, | |
| 19 const std::string& id) { | |
| 20 BluetoothPermissionContext* permission_context = | |
|
Jeffrey Yasskin
2016/01/21 00:32:30
Something called "ChooserPermissionManager" can't
juncai
2016/01/25 18:53:31
Done.
| |
| 21 BluetoothPermissionContextFactory::GetForProfile(profile_); | |
| 22 permission_context->GrantDevicePermission(requesting_origin, embedding_origin, | |
| 23 id); | |
| 24 } | |
| 25 | |
| 26 void ChooserPermissionManager::RevokePermission( | |
| 27 const url::Origin& requesting_origin, | |
| 28 const url::Origin& embedding_origin, | |
| 29 const std::string& id) { | |
| 30 BluetoothPermissionContext* permission_context = | |
| 31 BluetoothPermissionContextFactory::GetForProfile(profile_); | |
| 32 permission_context->RevokeDevicePermission(requesting_origin, | |
| 33 embedding_origin, id); | |
| 34 } | |
| OLD | NEW |