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 "base/strings/string16.h" | |
| 12 #include "chrome/browser/permissions/chooser_context_base.h" | |
| 13 | |
| 14 class BluetoothChooserContext : public ChooserContextBase { | |
| 15 public: | |
| 16 explicit BluetoothChooserContext(Profile* profile); | |
| 17 ~BluetoothChooserContext() override; | |
| 18 | |
| 19 // Grants |requesting_origin| access to the Bluetooth device known as | |
| 20 // |device_name| and |device_id|. | |
| 21 void GrantDevicePermission(const GURL& requesting_origin, | |
| 22 const GURL& embedding_origin, | |
| 23 const base::string16& device_name, | |
| 24 const std::string& device_id); | |
| 25 | |
| 26 // Revokes |requesting_origin|'s access to the Bluetooth device known as | |
| 27 // |device_name| and |device_id|. | |
| 28 void RevokeDevicePermission(const GURL& requesting_origin, | |
| 29 const GURL& embedding_origin, | |
| 30 const base::string16& device_name, | |
|
Reilly Grant (use Gerrit)
2016/01/06 00:16:52
If |device_id| identifies the device then |device_
juncai
2016/01/06 17:14:00
Done.
| |
| 31 const std::string& device_id); | |
| 32 | |
| 33 // Checks if |requesting_origin| (when embedded within |embedding_origin| has | |
| 34 // access to the Bluetooth device known as |device_name| and |device_id|. | |
| 35 bool HasDevicePermission(const GURL& requesting_origin, | |
| 36 const GURL& embedding_origin, | |
| 37 const base::string16& device_name, | |
|
Reilly Grant (use Gerrit)
2016/01/06 00:16:52
Same here.
juncai
2016/01/06 17:14:01
Done.
| |
| 38 const std::string& device_id); | |
| 39 | |
| 40 private: | |
| 41 // ChooserContextBase: | |
| 42 bool IsValidObject(const base::DictionaryValue& object) override; | |
| 43 | |
| 44 DISALLOW_COPY_AND_ASSIGN(BluetoothChooserContext); | |
| 45 }; | |
| 46 | |
| 47 #endif // CHROME_BROWSER_UI_BLUETOOTH_BLUETOOTH_CHOOSER_CONTEXT_H_ | |
| OLD | NEW |