Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Side by Side Diff: chrome/browser/permissions/chooser_permission_manager.cc

Issue 1560263002: Store Bluetooth permissions in website settings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added code to check session->chooser_permission_manager Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698