| OLD | NEW |
| 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 <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 class BluetoothAdapterFactory; | 28 class BluetoothAdapterFactory; |
| 29 class BluetoothAdapterWinTest; | 29 class BluetoothAdapterWinTest; |
| 30 class BluetoothDevice; | 30 class BluetoothDevice; |
| 31 | 31 |
| 32 class BluetoothAdapterWin : public BluetoothAdapter, | 32 class BluetoothAdapterWin : public BluetoothAdapter, |
| 33 public BluetoothTaskManagerWin::Observer { | 33 public BluetoothTaskManagerWin::Observer { |
| 34 public: | 34 public: |
| 35 typedef base::Callback<void()> InitCallback; | 35 typedef base::Callback<void()> InitCallback; |
| 36 | 36 |
| 37 void PostInit(scoped_refptr<base::SequencedTaskRunner> ui_task_runner, |
| 38 scoped_refptr<base::SequencedTaskRunner> file_task_runner, |
| 39 net::NetLog* net_log, |
| 40 const net::NetLog::Source& net_log_source); |
| 41 |
| 37 // BluetoothAdapter override | 42 // BluetoothAdapter override |
| 38 virtual void AddObserver(BluetoothAdapter::Observer* observer) OVERRIDE; | 43 virtual void AddObserver(BluetoothAdapter::Observer* observer) OVERRIDE; |
| 39 virtual void RemoveObserver(BluetoothAdapter::Observer* observer) OVERRIDE; | 44 virtual void RemoveObserver(BluetoothAdapter::Observer* observer) OVERRIDE; |
| 40 virtual std::string GetAddress() const OVERRIDE; | 45 virtual std::string GetAddress() const OVERRIDE; |
| 41 virtual std::string GetName() const OVERRIDE; | 46 virtual std::string GetName() const OVERRIDE; |
| 42 virtual void SetName(const std::string& name, | 47 virtual void SetName(const std::string& name, |
| 43 const base::Closure& callback, | 48 const base::Closure& callback, |
| 44 const ErrorCallback& error_callback) OVERRIDE; | 49 const ErrorCallback& error_callback) OVERRIDE; |
| 45 virtual bool IsInitialized() const OVERRIDE; | 50 virtual bool IsInitialized() const OVERRIDE; |
| 46 virtual bool IsPresent() const OVERRIDE; | 51 virtual bool IsPresent() const OVERRIDE; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 bool powered_; | 119 bool powered_; |
| 115 DiscoveryStatus discovery_status_; | 120 DiscoveryStatus discovery_status_; |
| 116 base::hash_set<std::string> discovered_devices_; | 121 base::hash_set<std::string> discovered_devices_; |
| 117 | 122 |
| 118 std::vector<std::pair<base::Closure, ErrorCallback> > | 123 std::vector<std::pair<base::Closure, ErrorCallback> > |
| 119 on_start_discovery_callbacks_; | 124 on_start_discovery_callbacks_; |
| 120 std::vector<base::Closure> on_stop_discovery_callbacks_; | 125 std::vector<base::Closure> on_stop_discovery_callbacks_; |
| 121 size_t num_discovery_listeners_; | 126 size_t num_discovery_listeners_; |
| 122 | 127 |
| 123 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; | 128 scoped_refptr<base::SequencedTaskRunner> ui_task_runner_; |
| 129 scoped_refptr<base::SequencedTaskRunner> file_task_runner_; |
| 130 net::NetLog* net_log_; |
| 131 net::NetLog::Source net_log_source_; |
| 124 scoped_refptr<BluetoothTaskManagerWin> task_manager_; | 132 scoped_refptr<BluetoothTaskManagerWin> task_manager_; |
| 125 | 133 |
| 126 base::ThreadChecker thread_checker_; | 134 base::ThreadChecker thread_checker_; |
| 127 | 135 |
| 128 // List of observers interested in event notifications from us. | 136 // List of observers interested in event notifications from us. |
| 129 ObserverList<BluetoothAdapter::Observer> observers_; | 137 ObserverList<BluetoothAdapter::Observer> observers_; |
| 130 | 138 |
| 131 // NOTE: This should remain the last member so it'll be destroyed and | 139 // NOTE: This should remain the last member so it'll be destroyed and |
| 132 // invalidate its weak pointers before any other members are destroyed. | 140 // invalidate its weak pointers before any other members are destroyed. |
| 133 base::WeakPtrFactory<BluetoothAdapterWin> weak_ptr_factory_; | 141 base::WeakPtrFactory<BluetoothAdapterWin> weak_ptr_factory_; |
| 134 | 142 |
| 135 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterWin); | 143 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterWin); |
| 136 }; | 144 }; |
| 137 | 145 |
| 138 } // namespace device | 146 } // namespace device |
| 139 | 147 |
| 140 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_WIN_H_ | 148 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_WIN_H_ |
| OLD | NEW |