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

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

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

Powered by Google App Engine
This is Rietveld 408576698