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

Unified Diff: trunk/src/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc

Issue 224763003: Revert 261566 "device/bluetooth: Rename device::bluetooth_utils:..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 9 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: trunk/src/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc
===================================================================
--- trunk/src/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc (revision 261569)
+++ trunk/src/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc (working copy)
@@ -19,6 +19,7 @@
#include "device/bluetooth/bluetooth_profile.h"
#include "device/bluetooth/bluetooth_service_record.h"
#include "device/bluetooth/bluetooth_socket.h"
+#include "device/bluetooth/bluetooth_utils.h"
#include "extensions/browser/event_router.h"
#include "extensions/browser/extension_system.h"
#include "extensions/common/permissions/permissions_data.h"
@@ -133,9 +134,7 @@
scoped_ptr<AddProfile::Params> params(AddProfile::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get() != NULL);
- device::BluetoothUUID uuid(params->profile.uuid);
-
- if (!uuid.IsValid()) {
+ if (!BluetoothDevice::IsUUIDValid(params->profile.uuid)) {
SetError(kInvalidUuid);
return false;
}
@@ -146,7 +145,7 @@
return false;
}
- uuid_ = uuid;
+ uuid_ = device::bluetooth_utils::CanonicalUuid(params->profile.uuid);
if (GetEventRouter(browser_context())->HasProfile(uuid_)) {
SetError(kProfileAlreadyRegistered);
@@ -217,13 +216,14 @@
scoped_ptr<RemoveProfile::Params> params(
RemoveProfile::Params::Create(*args_));
- device::BluetoothUUID uuid(params->profile.uuid);
-
- if (!uuid.IsValid()) {
+ if (!BluetoothDevice::IsUUIDValid(params->profile.uuid)) {
SetError(kInvalidUuid);
return false;
}
+ std::string uuid =
+ device::bluetooth_utils::CanonicalUuid(params->profile.uuid);
+
if (!GetEventRouter(browser_context())->HasProfile(uuid)) {
SetError(kProfileNotFound);
return false;
@@ -303,9 +303,7 @@
EXTENSION_FUNCTION_VALIDATE(params.get() != NULL);
const bluetooth::ConnectOptions& options = params->options;
- device::BluetoothUUID uuid(options.profile.uuid);
-
- if (!uuid.IsValid()) {
+ if (!BluetoothDevice::IsUUIDValid(options.profile.uuid)) {
SetError(kInvalidUuid);
SendResponse(false);
return false;
@@ -318,6 +316,9 @@
return false;
}
+ std::string uuid = device::bluetooth_utils::CanonicalUuid(
+ options.profile.uuid);
+
BluetoothProfile* bluetooth_profile =
GetEventRouter(browser_context())->GetProfile(uuid);
if (!bluetooth_profile) {

Powered by Google App Engine
This is Rietveld 408576698