Index: chrome/browser/ui/bluetooth/bluetooth_chooser_context.h |
diff --git a/chrome/browser/ui/bluetooth/bluetooth_chooser_context.h b/chrome/browser/ui/bluetooth/bluetooth_chooser_context.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9c7da44c8769365d81e57689d5526b85f4aa7bce |
--- /dev/null |
+++ b/chrome/browser/ui/bluetooth/bluetooth_chooser_context.h |
@@ -0,0 +1,47 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_UI_BLUETOOTH_BLUETOOTH_CHOOSER_CONTEXT_H_ |
+#define CHROME_BROWSER_UI_BLUETOOTH_BLUETOOTH_CHOOSER_CONTEXT_H_ |
+ |
+#include <string> |
+ |
+#include "base/macros.h" |
+#include "base/strings/string16.h" |
+#include "chrome/browser/permissions/chooser_context_base.h" |
+ |
+class BluetoothChooserContext : public ChooserContextBase { |
+ public: |
+ explicit BluetoothChooserContext(Profile* profile); |
+ ~BluetoothChooserContext() override; |
+ |
+ // Grants |requesting_origin| access to the Bluetooth device known as |
+ // |device_name| and |device_id|. |
+ void GrantDevicePermission(const GURL& requesting_origin, |
+ const GURL& embedding_origin, |
+ const base::string16& device_name, |
+ const std::string& device_id); |
+ |
+ // Revokes |requesting_origin|'s access to the Bluetooth device known as |
+ // |device_name| and |device_id|. |
+ void RevokeDevicePermission(const GURL& requesting_origin, |
+ const GURL& embedding_origin, |
+ 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.
|
+ const std::string& device_id); |
+ |
+ // Checks if |requesting_origin| (when embedded within |embedding_origin| has |
+ // access to the Bluetooth device known as |device_name| and |device_id|. |
+ bool HasDevicePermission(const GURL& requesting_origin, |
+ const GURL& embedding_origin, |
+ 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.
|
+ const std::string& device_id); |
+ |
+ private: |
+ // ChooserContextBase: |
+ bool IsValidObject(const base::DictionaryValue& object) override; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(BluetoothChooserContext); |
+}; |
+ |
+#endif // CHROME_BROWSER_UI_BLUETOOTH_BLUETOOTH_CHOOSER_CONTEXT_H_ |