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

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

Issue 220323004: device/bluetooth: Rename device::bluetooth_utils::UUID to device::BluetoothUUID (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initialized |empty_device_| in BluetoothDeviceWinTest. 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: chrome/browser/extensions/api/bluetooth/bluetooth_api.cc
diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc b/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc
index aff3f8e0e03834cfaf0f649059cd349b1d53aba0..d520f3dd996267ceb5e69fd0b6c20f2d1067e61c 100644
--- a/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc
+++ b/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc
@@ -19,7 +19,6 @@
#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"
@@ -134,7 +133,9 @@ bool BluetoothAddProfileFunction::RunImpl() {
scoped_ptr<AddProfile::Params> params(AddProfile::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get() != NULL);
- if (!BluetoothDevice::IsUUIDValid(params->profile.uuid)) {
+ device::BluetoothUUID uuid(params->profile.uuid);
+
+ if (!uuid.IsValid()) {
SetError(kInvalidUuid);
return false;
}
@@ -145,7 +146,7 @@ bool BluetoothAddProfileFunction::RunImpl() {
return false;
}
- uuid_ = device::bluetooth_utils::CanonicalUuid(params->profile.uuid);
+ uuid_ = uuid;
if (GetEventRouter(browser_context())->HasProfile(uuid_)) {
SetError(kProfileAlreadyRegistered);
@@ -216,14 +217,13 @@ bool BluetoothRemoveProfileFunction::RunImpl() {
scoped_ptr<RemoveProfile::Params> params(
RemoveProfile::Params::Create(*args_));
- if (!BluetoothDevice::IsUUIDValid(params->profile.uuid)) {
+ device::BluetoothUUID uuid(params->profile.uuid);
+
+ if (!uuid.IsValid()) {
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,7 +303,9 @@ bool BluetoothConnectFunction::DoWork(scoped_refptr<BluetoothAdapter> adapter) {
EXTENSION_FUNCTION_VALIDATE(params.get() != NULL);
const bluetooth::ConnectOptions& options = params->options;
- if (!BluetoothDevice::IsUUIDValid(options.profile.uuid)) {
+ device::BluetoothUUID uuid(options.profile.uuid);
+
+ if (!uuid.IsValid()) {
SetError(kInvalidUuid);
SendResponse(false);
return false;
@@ -316,9 +318,6 @@ bool BluetoothConnectFunction::DoWork(scoped_refptr<BluetoothAdapter> adapter) {
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