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

Side by Side Diff: device/bluetooth/bluetooth_adapter_win.cc

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
« no previous file with comments | « device/bluetooth/bluetooth_adapter_win.h ('k') | no next file » | 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 "device/bluetooth/bluetooth_adapter_win.h" 5 #include "device/bluetooth/bluetooth_adapter_win.h"
6 6
7 #include <hash_set> 7 #include <hash_set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 weak_ptr_factory_(this) { 46 weak_ptr_factory_(this) {
47 } 47 }
48 48
49 BluetoothAdapterWin::~BluetoothAdapterWin() { 49 BluetoothAdapterWin::~BluetoothAdapterWin() {
50 if (task_manager_.get()) { 50 if (task_manager_.get()) {
51 task_manager_->RemoveObserver(this); 51 task_manager_->RemoveObserver(this);
52 task_manager_->Shutdown(); 52 task_manager_->Shutdown();
53 } 53 }
54 } 54 }
55 55
56 void BluetoothAdapterWin::AddObserver(BluetoothAdapter::Observer* observer) {
57 DCHECK(observer);
58 observers_.AddObserver(observer);
59 }
60
61 void BluetoothAdapterWin::RemoveObserver(BluetoothAdapter::Observer* observer) {
62 DCHECK(observer);
63 observers_.RemoveObserver(observer);
64 }
65
66 std::string BluetoothAdapterWin::GetAddress() const { 56 std::string BluetoothAdapterWin::GetAddress() const {
67 return address_; 57 return address_;
68 } 58 }
69 59
70 std::string BluetoothAdapterWin::GetName() const { 60 std::string BluetoothAdapterWin::GetName() const {
71 return name_; 61 return name_;
72 } 62 }
73 63
74 void BluetoothAdapterWin::SetName(const std::string& name, 64 void BluetoothAdapterWin::SetName(const std::string& name,
75 const base::Closure& callback, 65 const base::Closure& callback,
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 num_discovery_listeners_ -= on_stop_discovery_callbacks_.size(); 364 num_discovery_listeners_ -= on_stop_discovery_callbacks_.size();
375 on_stop_discovery_callbacks_.clear(); 365 on_stop_discovery_callbacks_.clear();
376 return; 366 return;
377 } 367 }
378 368
379 discovery_status_ = DISCOVERY_STOPPING; 369 discovery_status_ = DISCOVERY_STOPPING;
380 task_manager_->PostStopDiscoveryTask(); 370 task_manager_->PostStopDiscoveryTask();
381 } 371 }
382 372
383 } // namespace device 373 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_adapter_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698