| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // |adapter| should be the adapter used to scan for Bluetooth devices. | 43 // |adapter| should be the adapter used to scan for Bluetooth devices. |
| 44 BluetoothDeviceChooserController( | 44 BluetoothDeviceChooserController( |
| 45 WebBluetoothServiceImpl* web_bluetooth_service_, | 45 WebBluetoothServiceImpl* web_bluetooth_service_, |
| 46 RenderFrameHost* render_frame_host, | 46 RenderFrameHost* render_frame_host, |
| 47 device::BluetoothAdapter* adapter); | 47 device::BluetoothAdapter* adapter); |
| 48 ~BluetoothDeviceChooserController(); | 48 ~BluetoothDeviceChooserController(); |
| 49 | 49 |
| 50 // This function performs the following checks before starting a discovery | 50 // This function performs the following checks before starting a discovery |
| 51 // session: | 51 // session: |
| 52 // - Validates filters in |request_device_options|. | 52 // - Validates filters in |request_device_options|. |
| 53 // - Removes any blacklisted UUIDs from | 53 // - Removes any blocklisted UUIDs from |
| 54 // |request_device_options.optinal_services|. | 54 // |request_device_options.optinal_services|. |
| 55 // - Checks if the request came from a cross-origin iframe. | 55 // - Checks if the request came from a cross-origin iframe. |
| 56 // - Checks if the request came from a unique origin. | 56 // - Checks if the request came from a unique origin. |
| 57 // - Checks if the adapter is present. | 57 // - Checks if the adapter is present. |
| 58 // - Checks if the Web Bluetooth API has been disabled. | 58 // - Checks if the Web Bluetooth API has been disabled. |
| 59 // - Checks if we are allowed to ask for scanning permission. | 59 // - Checks if we are allowed to ask for scanning permission. |
| 60 // If any of the previous checks failed then this function runs | 60 // If any of the previous checks failed then this function runs |
| 61 // |error_callback| with the corresponding error. Otherwise this function | 61 // |error_callback| with the corresponding error. Otherwise this function |
| 62 // populates the embedder provided BluetoothChooser with existing devices and | 62 // populates the embedder provided BluetoothChooser with existing devices and |
| 63 // starts a new discovery session. | 63 // starts a new discovery session. |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // Weak pointer factory for generating 'this' pointers that might live longer | 148 // Weak pointer factory for generating 'this' pointers that might live longer |
| 149 // than we do. | 149 // than we do. |
| 150 // Note: This should remain the last member so it'll be destroyed and | 150 // Note: This should remain the last member so it'll be destroyed and |
| 151 // invalidate its weak pointers before any other members are destroyed. | 151 // invalidate its weak pointers before any other members are destroyed. |
| 152 base::WeakPtrFactory<BluetoothDeviceChooserController> weak_ptr_factory_; | 152 base::WeakPtrFactory<BluetoothDeviceChooserController> weak_ptr_factory_; |
| 153 }; | 153 }; |
| 154 | 154 |
| 155 } // namespace content | 155 } // namespace content |
| 156 | 156 |
| 157 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DEVICE_CHOOSER_CONTROLLER_H_ | 157 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DEVICE_CHOOSER_CONTROLLER_H_ |
| OLD | NEW |