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

Side by Side Diff: chrome/browser/extensions/api/bluetooth/bluetooth_api.cc

Issue 288903003: [Bluetooth] Standardize Bluetooth device address format to XX:XX:XX:XX:XX:XX. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ChromeOS tests too Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chromeos/dbus/fake_bluetooth_adapter_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/api/bluetooth/bluetooth_api.h" 5 #include "chrome/browser/extensions/api/bluetooth/bluetooth_api.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 } 289 }
290 290
291 BluetoothGetDeviceFunction::~BluetoothGetDeviceFunction() {} 291 BluetoothGetDeviceFunction::~BluetoothGetDeviceFunction() {}
292 292
293 bool BluetoothGetDeviceFunction::DoWork( 293 bool BluetoothGetDeviceFunction::DoWork(
294 scoped_refptr<BluetoothAdapter> adapter) { 294 scoped_refptr<BluetoothAdapter> adapter) {
295 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 295 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
296 296
297 scoped_ptr<GetDevice::Params> params(GetDevice::Params::Create(*args_)); 297 scoped_ptr<GetDevice::Params> params(GetDevice::Params::Create(*args_));
298 EXTENSION_FUNCTION_VALIDATE(params.get() != NULL); 298 EXTENSION_FUNCTION_VALIDATE(params.get() != NULL);
299 const std::string& device_address = params->device_address;
300 299
301 BluetoothDevice* device = adapter->GetDevice(device_address); 300 BluetoothDevice* device = adapter->GetDevice(params->device_address);
302 if (device) { 301 if (device) {
303 bluetooth::Device extension_device; 302 bluetooth::Device extension_device;
304 bluetooth::BluetoothDeviceToApiDevice(*device, &extension_device); 303 bluetooth::BluetoothDeviceToApiDevice(*device, &extension_device);
305 SetResult(extension_device.ToValue().release()); 304 SetResult(extension_device.ToValue().release());
306 SendResponse(true); 305 SendResponse(true);
307 } else { 306 } else {
308 SetError(kInvalidDevice); 307 SetError(kInvalidDevice);
309 SendResponse(false); 308 SendResponse(false);
310 } 309 }
311 310
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 adapter, 667 adapter,
669 extension_id(), 668 extension_id(),
670 base::Bind(&BluetoothStopDiscoveryFunction::OnSuccessCallback, this), 669 base::Bind(&BluetoothStopDiscoveryFunction::OnSuccessCallback, this),
671 base::Bind(&BluetoothStopDiscoveryFunction::OnErrorCallback, this)); 670 base::Bind(&BluetoothStopDiscoveryFunction::OnErrorCallback, this));
672 671
673 return true; 672 return true;
674 } 673 }
675 674
676 } // namespace api 675 } // namespace api
677 } // namespace extensions 676 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chromeos/dbus/fake_bluetooth_adapter_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698