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 #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_ | |
| OLD | NEW |