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

Side by Side Diff: trunk/src/device/bluetooth/bluetooth_device_chromeos.cc

Issue 224763003: Revert 261566 "device/bluetooth: Rename device::bluetooth_utils:..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 8 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "device/bluetooth/bluetooth_device_chromeos.h" 5 #include "device/bluetooth/bluetooth_device_chromeos.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 bool BluetoothDeviceChromeOS::IsConnecting() const { 212 bool BluetoothDeviceChromeOS::IsConnecting() const {
213 return num_connecting_calls_ > 0; 213 return num_connecting_calls_ > 0;
214 } 214 }
215 215
216 BluetoothDeviceChromeOS::UUIDList BluetoothDeviceChromeOS::GetUUIDs() const { 216 BluetoothDeviceChromeOS::UUIDList BluetoothDeviceChromeOS::GetUUIDs() const {
217 BluetoothDeviceClient::Properties* properties = 217 BluetoothDeviceClient::Properties* properties =
218 DBusThreadManager::Get()->GetBluetoothDeviceClient()-> 218 DBusThreadManager::Get()->GetBluetoothDeviceClient()->
219 GetProperties(object_path_); 219 GetProperties(object_path_);
220 DCHECK(properties); 220 DCHECK(properties);
221 221
222 std::vector<device::BluetoothUUID> uuids; 222 return properties->uuids.value();
223 const std::vector<std::string> &dbus_uuids = properties->uuids.value();
224 for (std::vector<std::string>::const_iterator iter = dbus_uuids.begin();
225 iter != dbus_uuids.end(); ++iter) {
226 device::BluetoothUUID uuid(*iter);
227 DCHECK(uuid.IsValid());
228 uuids.push_back(uuid);
229 }
230 return uuids;
231 } 223 }
232 224
233 bool BluetoothDeviceChromeOS::ExpectingPinCode() const { 225 bool BluetoothDeviceChromeOS::ExpectingPinCode() const {
234 return pairing_.get() && pairing_->ExpectingPinCode(); 226 return pairing_.get() && pairing_->ExpectingPinCode();
235 } 227 }
236 228
237 bool BluetoothDeviceChromeOS::ExpectingPasskey() const { 229 bool BluetoothDeviceChromeOS::ExpectingPasskey() const {
238 return pairing_.get() && pairing_->ExpectingPasskey(); 230 return pairing_.get() && pairing_->ExpectingPasskey();
239 } 231 }
240 232
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 RemoveDevice( 337 RemoveDevice(
346 adapter_->object_path_, 338 adapter_->object_path_,
347 object_path_, 339 object_path_,
348 base::Bind(&base::DoNothing), 340 base::Bind(&base::DoNothing),
349 base::Bind(&BluetoothDeviceChromeOS::OnForgetError, 341 base::Bind(&BluetoothDeviceChromeOS::OnForgetError,
350 weak_ptr_factory_.GetWeakPtr(), 342 weak_ptr_factory_.GetWeakPtr(),
351 error_callback)); 343 error_callback));
352 } 344 }
353 345
354 void BluetoothDeviceChromeOS::ConnectToService( 346 void BluetoothDeviceChromeOS::ConnectToService(
355 const device::BluetoothUUID& service_uuid, 347 const std::string& service_uuid,
356 const SocketCallback& callback) { 348 const SocketCallback& callback) {
357 // TODO(keybuk): implement 349 // TODO(keybuk): implement
358 callback.Run(scoped_refptr<device::BluetoothSocket>()); 350 callback.Run(scoped_refptr<device::BluetoothSocket>());
359 } 351 }
360 352
361 void BluetoothDeviceChromeOS::ConnectToProfile( 353 void BluetoothDeviceChromeOS::ConnectToProfile(
362 device::BluetoothProfile* profile, 354 device::BluetoothProfile* profile,
363 const base::Closure& callback, 355 const base::Closure& callback,
364 const ErrorCallback& error_callback) { 356 const ErrorCallback& error_callback) {
365 BluetoothProfileChromeOS* profile_chromeos = 357 BluetoothProfileChromeOS* profile_chromeos =
366 static_cast<BluetoothProfileChromeOS*>(profile); 358 static_cast<BluetoothProfileChromeOS*>(profile);
367 VLOG(1) << object_path_.value() << ": Connecting profile: " 359 VLOG(1) << object_path_.value() << ": Connecting profile: "
368 << profile_chromeos->uuid().canonical_value(); 360 << profile_chromeos->uuid();
369 DBusThreadManager::Get()->GetBluetoothDeviceClient()-> 361 DBusThreadManager::Get()->GetBluetoothDeviceClient()->
370 ConnectProfile( 362 ConnectProfile(
371 object_path_, 363 object_path_,
372 profile_chromeos->uuid().canonical_value(), 364 profile_chromeos->uuid(),
373 base::Bind( 365 base::Bind(
374 &BluetoothDeviceChromeOS::OnConnectProfile, 366 &BluetoothDeviceChromeOS::OnConnectProfile,
375 weak_ptr_factory_.GetWeakPtr(), 367 weak_ptr_factory_.GetWeakPtr(),
376 profile, 368 profile,
377 callback), 369 callback),
378 base::Bind( 370 base::Bind(
379 &BluetoothDeviceChromeOS::OnConnectProfileError, 371 &BluetoothDeviceChromeOS::OnConnectProfileError,
380 weak_ptr_factory_.GetWeakPtr(), 372 weak_ptr_factory_.GetWeakPtr(),
381 profile, 373 profile,
382 error_callback)); 374 error_callback));
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 << error_name << ": " << error_message; 560 << error_name << ": " << error_message;
569 error_callback.Run(); 561 error_callback.Run();
570 } 562 }
571 563
572 void BluetoothDeviceChromeOS::OnConnectProfile( 564 void BluetoothDeviceChromeOS::OnConnectProfile(
573 device::BluetoothProfile* profile, 565 device::BluetoothProfile* profile,
574 const base::Closure& callback) { 566 const base::Closure& callback) {
575 BluetoothProfileChromeOS* profile_chromeos = 567 BluetoothProfileChromeOS* profile_chromeos =
576 static_cast<BluetoothProfileChromeOS*>(profile); 568 static_cast<BluetoothProfileChromeOS*>(profile);
577 VLOG(1) << object_path_.value() << ": Profile connected: " 569 VLOG(1) << object_path_.value() << ": Profile connected: "
578 << profile_chromeos->uuid().canonical_value(); 570 << profile_chromeos->uuid();
579 callback.Run(); 571 callback.Run();
580 } 572 }
581 573
582 void BluetoothDeviceChromeOS::OnConnectProfileError( 574 void BluetoothDeviceChromeOS::OnConnectProfileError(
583 device::BluetoothProfile* profile, 575 device::BluetoothProfile* profile,
584 const ErrorCallback& error_callback, 576 const ErrorCallback& error_callback,
585 const std::string& error_name, 577 const std::string& error_name,
586 const std::string& error_message) { 578 const std::string& error_message) {
587 BluetoothProfileChromeOS* profile_chromeos = 579 BluetoothProfileChromeOS* profile_chromeos =
588 static_cast<BluetoothProfileChromeOS*>(profile); 580 static_cast<BluetoothProfileChromeOS*>(profile);
589 VLOG(1) << object_path_.value() << ": Profile connection failed: " 581 VLOG(1) << object_path_.value() << ": Profile connection failed: "
590 << profile_chromeos->uuid().canonical_value() << ": " 582 << profile_chromeos->uuid() << ": "
591 << error_name << ": " << error_message; 583 << error_name << ": " << error_message;
592 error_callback.Run(); 584 error_callback.Run();
593 } 585 }
594 586
595 } // namespace chromeos 587 } // namespace chromeos
OLDNEW
« no previous file with comments | « trunk/src/device/bluetooth/bluetooth_device_chromeos.h ('k') | trunk/src/device/bluetooth/bluetooth_device_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698