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/bluetooth/bluetooth_permission_context.h" |
| 8 #include "chrome/browser/bluetooth/bluetooth_permission_context_factory.h" |
| 9 #include "chrome/browser/permissions/chooser_context.h" |
| 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "content/public/browser/permission_type.h" |
| 12 #include "url/gurl.h" |
| 13 #include "url/origin.h" |
| 14 |
| 15 ChooserPermissionManager::ChooserPermissionManager(Profile* profile) |
| 16 : profile_(profile) {} |
| 17 |
| 18 ChooserPermissionManager::~ChooserPermissionManager() {} |
| 19 |
| 20 void ChooserPermissionManager::GrantPermission( |
| 21 content::PermissionType permission_type, |
| 22 const url::Origin& requesting_origin, |
| 23 const url::Origin& embedding_origin, |
| 24 scoped_ptr<base::DictionaryValue> object) { |
| 25 ChooserContextBase* chooser_context_base = |
| 26 ChooserContext::Get(profile_, permission_type); |
| 27 chooser_context_base->GrantObjectPermission( |
| 28 GURL(requesting_origin.Serialize()), GURL(embedding_origin.Serialize()), |
| 29 std::move(object)); |
| 30 } |
| 31 |
| 32 void ChooserPermissionManager::RevokePermission( |
| 33 content::PermissionType permission_type, |
| 34 const url::Origin& requesting_origin, |
| 35 const url::Origin& embedding_origin, |
| 36 const base::DictionaryValue& object) { |
| 37 ChooserContextBase* chooser_context_base = |
| 38 ChooserContext::Get(profile_, permission_type); |
| 39 chooser_context_base->RevokeObjectPermission( |
| 40 GURL(requesting_origin.Serialize()), GURL(embedding_origin.Serialize()), |
| 41 object); |
| 42 } |
OLD | NEW |