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

Unified Diff: chrome/common/extensions/api/bluetooth/bluetooth_manifest_permission.cc

Issue 325893002: Bluetooth: add socket & low_energy manifest check (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add permission denied tests Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/api/bluetooth/bluetooth_manifest_permission.cc
diff --git a/chrome/common/extensions/api/bluetooth/bluetooth_manifest_permission.cc b/chrome/common/extensions/api/bluetooth/bluetooth_manifest_permission.cc
index c5ead3c52a083df49a099e71762512a5e0a8b24a..2d6670d4ea80fdcf2337a112d6bfcd88e9f1e46d 100644
--- a/chrome/common/extensions/api/bluetooth/bluetooth_manifest_permission.cc
+++ b/chrome/common/extensions/api/bluetooth/bluetooth_manifest_permission.cc
@@ -56,7 +56,9 @@ bool ParseUuidArray(BluetoothManifestPermission* permission,
} // namespace
-BluetoothManifestPermission::BluetoothManifestPermission() {}
+BluetoothManifestPermission::BluetoothManifestPermission()
+ : socket_(false),
+ low_energy_(false) {}
BluetoothManifestPermission::~BluetoothManifestPermission() {}
@@ -76,6 +78,12 @@ scoped_ptr<BluetoothManifestPermission> BluetoothManifestPermission::FromValue(
return scoped_ptr<BluetoothManifestPermission>();
}
}
+ if (bluetooth->socket) {
+ result->socket_ = *(bluetooth->socket);
+ }
+ if (bluetooth->low_energy) {
+ result->low_energy_ = *(bluetooth->low_energy);
+ }
return result.Pass();
}
@@ -94,6 +102,16 @@ bool BluetoothManifestPermission::CheckRequest(
return false;
}
+bool BluetoothManifestPermission::CheckSocketPermitted(
+ const Extension* extension) const {
+ return socket_;
+}
+
+bool BluetoothManifestPermission::CheckLowEnergyPermitted(
+ const Extension* extension) const {
+ return low_energy_;
+}
+
std::string BluetoothManifestPermission::name() const {
return manifest_keys::kBluetooth;
}

Powered by Google App Engine
This is Rietveld 408576698