OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_BLUETOOTH_FIRST_DEVICE_BLUETOOTH_CHOOSER_H_ |
| 6 #define CONTENT_BROWSER_BLUETOOTH_FIRST_DEVICE_BLUETOOTH_CHOOSER_H_ |
| 7 |
| 8 #include "content/public/browser/bluetooth_chooser.h" |
| 9 |
| 10 namespace content { |
| 11 |
| 12 // Implements a Bluetooth chooser that, instead of showing a dialog, selects the |
| 13 // first added device, or cancels if no device is added before discovery stops. |
| 14 // This is used as a default chooser implementation for platforms without a full |
| 15 // UI. |
| 16 class FirstDeviceBluetoothChooser : public BluetoothChooser { |
| 17 public: |
| 18 // |observer| must outlive |this|. |
| 19 FirstDeviceBluetoothChooser(Observer* observer, int chooser_id) |
| 20 : BluetoothChooser(observer, chooser_id) {} |
| 21 |
| 22 // BluetoothChooser implementation: |
| 23 void SetAdapterPresence(AdapterPresence presence) override; |
| 24 void ShowDiscoveryState(DiscoveryState state) override; |
| 25 void AddDevice(const std::string& device_id, |
| 26 const base::string16& device_name) override; |
| 27 void RemoveDevice(const std::string& device_id) override {} |
| 28 }; |
| 29 |
| 30 } // namespace content |
| 31 |
| 32 #endif // CONTENT_BROWSER_BLUETOOTH_FIRST_DEVICE_BLUETOOTH_CHOOSER_H_ |
OLD | NEW |