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

Side by Side Diff: device/bluetooth/bluetooth_adapter_mac.mm

Issue 1057603004: bluetooth: Refactor (Add|Remove)Observer impls into BluetoothAdapter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bta-style-guide-ordering-
Patch Set: Merge TOT Created 5 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
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_adapter_mac.h" 5 #include "device/bluetooth/bluetooth_adapter_mac.h"
6 6
7 #import <IOBluetooth/objc/IOBluetoothDevice.h> 7 #import <IOBluetooth/objc/IOBluetoothDevice.h>
8 #import <IOBluetooth/objc/IOBluetoothHostController.h> 8 #import <IOBluetooth/objc/IOBluetoothHostController.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 num_discovery_sessions_(0), 57 num_discovery_sessions_(0),
58 classic_discovery_manager_( 58 classic_discovery_manager_(
59 BluetoothDiscoveryManagerMac::CreateClassic(this)), 59 BluetoothDiscoveryManagerMac::CreateClassic(this)),
60 weak_ptr_factory_(this) { 60 weak_ptr_factory_(this) {
61 DCHECK(classic_discovery_manager_.get()); 61 DCHECK(classic_discovery_manager_.get());
62 } 62 }
63 63
64 BluetoothAdapterMac::~BluetoothAdapterMac() { 64 BluetoothAdapterMac::~BluetoothAdapterMac() {
65 } 65 }
66 66
67 void BluetoothAdapterMac::AddObserver(BluetoothAdapter::Observer* observer) {
68 DCHECK(observer);
69 observers_.AddObserver(observer);
70 }
71
72 void BluetoothAdapterMac::RemoveObserver(BluetoothAdapter::Observer* observer) {
73 DCHECK(observer);
74 observers_.RemoveObserver(observer);
75 }
76
77 std::string BluetoothAdapterMac::GetAddress() const { 67 std::string BluetoothAdapterMac::GetAddress() const {
78 return address_; 68 return address_;
79 } 69 }
80 70
81 std::string BluetoothAdapterMac::GetName() const { 71 std::string BluetoothAdapterMac::GetName() const {
82 return name_; 72 return name_;
83 } 73 }
84 74
85 void BluetoothAdapterMac::SetName(const std::string& name, 75 void BluetoothAdapterMac::SetName(const std::string& name,
86 const base::Closure& callback, 76 const base::Closure& callback,
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 DCHECK_EQ(num_removed, 1U); 355 DCHECK_EQ(num_removed, 1U);
366 } 356 }
367 357
368 // Add any new paired devices. 358 // Add any new paired devices.
369 for (IOBluetoothDevice* device in [IOBluetoothDevice pairedDevices]) { 359 for (IOBluetoothDevice* device in [IOBluetoothDevice pairedDevices]) {
370 DeviceAdded(device); 360 DeviceAdded(device);
371 } 361 }
372 } 362 }
373 363
374 } // namespace device 364 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_adapter_mac.h ('k') | device/bluetooth/bluetooth_adapter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698