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" |
| 11 #include "base/optional.h" |
11 #include "base/time/time.h" | 12 #include "base/time/time.h" |
12 #include "base/timer/timer.h" | 13 #include "base/timer/timer.h" |
13 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
14 #include "content/public/browser/bluetooth_chooser.h" | 15 #include "content/public/browser/bluetooth_chooser.h" |
15 #include "third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.moj
om.h" | 16 #include "third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.moj
om.h" |
16 | 17 |
17 namespace device { | 18 namespace device { |
18 class BluetoothAdapter; | 19 class BluetoothAdapter; |
19 class BluetoothDevice; | 20 class BluetoothDevice; |
20 class BluetoothDiscoverySession; | 21 class BluetoothDiscoverySession; |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 // 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 |
139 // started. | 140 // started. |
140 base::Timer discovery_session_timer_; | 141 base::Timer discovery_session_timer_; |
141 | 142 |
142 // The last discovery session to be started. | 143 // The last discovery session to be started. |
143 // TODO(ortuno): This should be null unless there is an active discovery | 144 // TODO(ortuno): This should be null unless there is an active discovery |
144 // session. We need to null it when the platform stops discovery. | 145 // session. We need to null it when the platform stops discovery. |
145 // http://crbug.com/611852 | 146 // http://crbug.com/611852 |
146 std::unique_ptr<device::BluetoothDiscoverySession> discovery_session_; | 147 std::unique_ptr<device::BluetoothDiscoverySession> discovery_session_; |
147 | 148 |
| 149 // The time when scanning starts. |
| 150 base::Optional<base::TimeTicks> scanning_start_time_; |
| 151 |
148 // Weak pointer factory for generating 'this' pointers that might live longer | 152 // Weak pointer factory for generating 'this' pointers that might live longer |
149 // than we do. | 153 // than we do. |
150 // Note: This should remain the last member so it'll be destroyed and | 154 // Note: This should remain the last member so it'll be destroyed and |
151 // invalidate its weak pointers before any other members are destroyed. | 155 // invalidate its weak pointers before any other members are destroyed. |
152 base::WeakPtrFactory<BluetoothDeviceChooserController> weak_ptr_factory_; | 156 base::WeakPtrFactory<BluetoothDeviceChooserController> weak_ptr_factory_; |
153 }; | 157 }; |
154 | 158 |
155 } // namespace content | 159 } // namespace content |
156 | 160 |
157 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DEVICE_CHOOSER_CONTROLLER_H_ | 161 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DEVICE_CHOOSER_CONTROLLER_H_ |
OLD | NEW |