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

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

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 (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 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_WIN_H_ 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_WIN_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_WIN_H_ 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_WIN_H_
7 7
8 #include <hash_set> 8 #include <hash_set>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 23 matching lines...) Expand all
34 class BluetoothSocketThread; 34 class BluetoothSocketThread;
35 35
36 class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterWin 36 class DEVICE_BLUETOOTH_EXPORT BluetoothAdapterWin
37 : public BluetoothAdapter, 37 : public BluetoothAdapter,
38 public BluetoothTaskManagerWin::Observer { 38 public BluetoothTaskManagerWin::Observer {
39 public: 39 public:
40 static base::WeakPtr<BluetoothAdapter> CreateAdapter( 40 static base::WeakPtr<BluetoothAdapter> CreateAdapter(
41 const InitCallback& init_callback); 41 const InitCallback& init_callback);
42 42
43 // BluetoothAdapter: 43 // BluetoothAdapter:
44 virtual void AddObserver(BluetoothAdapter::Observer* observer) override;
45 virtual void RemoveObserver(BluetoothAdapter::Observer* observer) override;
46 virtual std::string GetAddress() const override; 44 virtual std::string GetAddress() const override;
47 virtual std::string GetName() const override; 45 virtual std::string GetName() const override;
48 virtual void SetName(const std::string& name, 46 virtual void SetName(const std::string& name,
49 const base::Closure& callback, 47 const base::Closure& callback,
50 const ErrorCallback& error_callback) override; 48 const ErrorCallback& error_callback) override;
51 virtual bool IsInitialized() const override; 49 virtual bool IsInitialized() const override;
52 virtual bool IsPresent() const override; 50 virtual bool IsPresent() const override;
53 virtual bool IsPowered() const override; 51 virtual bool IsPowered() const override;
54 virtual void SetPowered( 52 virtual void SetPowered(
55 bool discoverable, 53 bool discoverable,
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 on_start_discovery_callbacks_; 143 on_start_discovery_callbacks_;
146 std::vector<base::Closure> on_stop_discovery_callbacks_; 144 std::vector<base::Closure> on_stop_discovery_callbacks_;
147 size_t num_discovery_listeners_; 145 size_t num_discovery_listeners_;
148 146
149 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; 147 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_;
150 scoped_refptr<BluetoothSocketThread> socket_thread_; 148 scoped_refptr<BluetoothSocketThread> socket_thread_;
151 scoped_refptr<BluetoothTaskManagerWin> task_manager_; 149 scoped_refptr<BluetoothTaskManagerWin> task_manager_;
152 150
153 base::ThreadChecker thread_checker_; 151 base::ThreadChecker thread_checker_;
154 152
155 // List of observers interested in event notifications from us.
156 ObserverList<BluetoothAdapter::Observer> observers_;
157
158 // NOTE: This should remain the last member so it'll be destroyed and 153 // NOTE: This should remain the last member so it'll be destroyed and
159 // invalidate its weak pointers before any other members are destroyed. 154 // invalidate its weak pointers before any other members are destroyed.
160 base::WeakPtrFactory<BluetoothAdapterWin> weak_ptr_factory_; 155 base::WeakPtrFactory<BluetoothAdapterWin> weak_ptr_factory_;
161 156
162 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterWin); 157 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterWin);
163 }; 158 };
164 159
165 } // namespace device 160 } // namespace device
166 161
167 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_WIN_H_ 162 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_WIN_H_
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_adapter_unittest.cc ('k') | device/bluetooth/bluetooth_adapter_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698