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

Side by Side Diff: content/browser/bluetooth/bluetooth_device_chooser_controller.h

Issue 2663693002: Add listener for AdapterDiscoveringChanged on BT chooser-controller
Patch Set: Created 3 years, 10 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 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 #include <unordered_set> 9 #include <unordered_set>
10 10
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 const ErrorCallback& error_callback); 72 const ErrorCallback& error_callback);
73 73
74 // Adds a device to the chooser. Should only be called after GetDevice and 74 // Adds a device to the chooser. Should only be called after GetDevice and
75 // before either of the callbacks are run. 75 // before either of the callbacks are run.
76 void AddFilteredDevice(const device::BluetoothDevice& device); 76 void AddFilteredDevice(const device::BluetoothDevice& device);
77 77
78 // Stops the current discovery session and notifies the chooser 78 // Stops the current discovery session and notifies the chooser
79 // that the adapter changed states. 79 // that the adapter changed states.
80 void AdapterPoweredChanged(bool powered); 80 void AdapterPoweredChanged(bool powered);
81 81
82 // Stops the discovery session and notifies the chooser
83 // when discovery stops accidentally.
84 void AdapterDiscoveringChanged(bool discovering);
85
82 // Received Signal Strength Indicator (RSSI) is a measurement of the power 86 // Received Signal Strength Indicator (RSSI) is a measurement of the power
83 // present in a received radio signal. 87 // present in a received radio signal.
84 static int CalculateSignalStrengthLevel(int8_t rssi); 88 static int CalculateSignalStrengthLevel(int8_t rssi);
85 89
86 // After this method is called any new instance of 90 // After this method is called any new instance of
87 // BluetoothDeviceChooserController will have a scan duration of 0. 91 // BluetoothDeviceChooserController will have a scan duration of 0.
88 static void SetTestScanDurationForTesting(); 92 static void SetTestScanDurationForTesting();
89 93
90 private: 94 private:
91 // Populates the chooser with the GATT connected devices. 95 // Populates the chooser with the GATT connected devices.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 // Weak pointer factory for generating 'this' pointers that might live longer 160 // Weak pointer factory for generating 'this' pointers that might live longer
157 // than we do. 161 // than we do.
158 // Note: This should remain the last member so it'll be destroyed and 162 // Note: This should remain the last member so it'll be destroyed and
159 // invalidate its weak pointers before any other members are destroyed. 163 // invalidate its weak pointers before any other members are destroyed.
160 base::WeakPtrFactory<BluetoothDeviceChooserController> weak_ptr_factory_; 164 base::WeakPtrFactory<BluetoothDeviceChooserController> weak_ptr_factory_;
161 }; 165 };
162 166
163 } // namespace content 167 } // namespace content
164 168
165 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DEVICE_CHOOSER_CONTROLLER_H_ 169 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DEVICE_CHOOSER_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698