| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DEVICE_CHOOSER_CONTROLLER_H_ | 5 #ifndef CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DEVICE_CHOOSER_CONTROLLER_H_ |
| 6 #define CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DEVICE_CHOOSER_CONTROLLER_H_ | 6 #define CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DEVICE_CHOOSER_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 SuccessCallback success_callback_; | 133 SuccessCallback success_callback_; |
| 134 ErrorCallback error_callback_; | 134 ErrorCallback error_callback_; |
| 135 | 135 |
| 136 // The currently opened BluetoothChooser. | 136 // The currently opened BluetoothChooser. |
| 137 std::unique_ptr<BluetoothChooser> chooser_; | 137 std::unique_ptr<BluetoothChooser> chooser_; |
| 138 | 138 |
| 139 // Automatically stops Bluetooth discovery a set amount of time after it was | 139 // Automatically stops Bluetooth discovery a set amount of time after it was |
| 140 // started. | 140 // started. |
| 141 base::Timer discovery_session_timer_; | 141 base::Timer discovery_session_timer_; |
| 142 | 142 |
| 143 // It's possible to receive notifications about new devices after |
| 144 // we've told the chooser to be idle. In this case, we don't want to |
| 145 // update the chooser. This variable keeps track of whether or not the |
| 146 // chooser is idle and should no longer be updated. |
| 147 bool should_update_chooser_; |
| 148 |
| 143 // The last discovery session to be started. | 149 // The last discovery session to be started. |
| 144 // TODO(ortuno): This should be null unless there is an active discovery | 150 // TODO(ortuno): This should be null unless there is an active discovery |
| 145 // session. We need to null it when the platform stops discovery. | 151 // session. We need to null it when the platform stops discovery. |
| 146 // http://crbug.com/611852 | 152 // http://crbug.com/611852 |
| 147 std::unique_ptr<device::BluetoothDiscoverySession> discovery_session_; | 153 std::unique_ptr<device::BluetoothDiscoverySession> discovery_session_; |
| 148 | 154 |
| 149 // Weak pointer factory for generating 'this' pointers that might live longer | 155 // Weak pointer factory for generating 'this' pointers that might live longer |
| 150 // than we do. | 156 // than we do. |
| 151 // Note: This should remain the last member so it'll be destroyed and | 157 // Note: This should remain the last member so it'll be destroyed and |
| 152 // invalidate its weak pointers before any other members are destroyed. | 158 // invalidate its weak pointers before any other members are destroyed. |
| 153 base::WeakPtrFactory<BluetoothDeviceChooserController> weak_ptr_factory_; | 159 base::WeakPtrFactory<BluetoothDeviceChooserController> weak_ptr_factory_; |
| 154 }; | 160 }; |
| 155 | 161 |
| 156 } // namespace content | 162 } // namespace content |
| 157 | 163 |
| 158 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DEVICE_CHOOSER_CONTROLLER_H_ | 164 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DEVICE_CHOOSER_CONTROLLER_H_ |
| OLD | NEW |