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

Side by Side Diff: chrome/browser/ui/bluetooth/bluetooth_chooser_context.h

Issue 1560263002: Store Bluetooth permissions in website settings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address reillyg@'s comments 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 #ifndef CHROME_BROWSER_UI_BLUETOOTH_BLUETOOTH_CHOOSER_CONTEXT_H_
6 #define CHROME_BROWSER_UI_BLUETOOTH_BLUETOOTH_CHOOSER_CONTEXT_H_
7
8 #include <string>
9
10 #include "base/macros.h"
11 #include "chrome/browser/permissions/chooser_context_base.h"
12
13 class BluetoothChooserContext : public ChooserContextBase {
Jeffrey Yasskin 2016/01/06 19:10:55 Is "ChooserContext" the right class name here? IIU
juncai 2016/01/11 21:55:16 Renamed it to class BluetoothPermissionContext. D
14 public:
15 explicit BluetoothChooserContext(Profile* profile);
16 ~BluetoothChooserContext() override;
17
18 // Grants |requesting_origin| access to the Bluetooth device known as
19 // |device_id|.
Jeffrey Yasskin 2016/01/06 19:10:55 We also need to store the set of allowed service U
Jeffrey Yasskin 2016/01/06 19:10:55 "known as |device_id|" doesn't really tell us whic
juncai 2016/01/11 21:55:16 Done.
juncai 2016/01/11 21:55:16 Done.
20 void GrantDevicePermission(const GURL& requesting_origin,
21 const GURL& embedding_origin,
22 const std::string& device_id);
23
24 // Revokes |requesting_origin|'s access to the Bluetooth device known as
25 // |device_id|.
26 void RevokeDevicePermission(const GURL& requesting_origin,
27 const GURL& embedding_origin,
28 const std::string& device_id);
29
30 // Checks if |requesting_origin| (when embedded within |embedding_origin| has
31 // access to the Bluetooth device known as |device_id|.
32 bool HasDevicePermission(const GURL& requesting_origin,
Jeffrey Yasskin 2016/01/06 19:10:55 This'll probably need to return the set of service
juncai 2016/01/11 21:55:16 Done.
33 const GURL& embedding_origin,
34 const std::string& device_id);
35
36 private:
37 // ChooserContextBase:
38 bool IsValidObject(const base::DictionaryValue& object) override;
39
40 DISALLOW_COPY_AND_ASSIGN(BluetoothChooserContext);
41 };
42
43 #endif // CHROME_BROWSER_UI_BLUETOOTH_BLUETOOTH_CHOOSER_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698