| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 #include "chrome/browser/ui/bluetooth/bluetooth_chooser_desktop.h" | 5 #include "chrome/browser/ui/bluetooth/bluetooth_chooser_desktop.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/ui/bluetooth/bluetooth_chooser_controller.h" | 8 #include "chrome/browser/ui/bluetooth/bluetooth_chooser_controller.h" |
| 9 #include "content/browser/bluetooth/bluetooth_device_chooser_controller.h" |
| 9 | 10 |
| 10 BluetoothChooserDesktop::BluetoothChooserDesktop( | 11 BluetoothChooserDesktop::BluetoothChooserDesktop( |
| 11 BluetoothChooserController* bluetooth_chooser_controller) | 12 BluetoothChooserController* bluetooth_chooser_controller) |
| 12 : bluetooth_chooser_controller_(bluetooth_chooser_controller) { | 13 : bluetooth_chooser_controller_(bluetooth_chooser_controller) { |
| 13 DCHECK(bluetooth_chooser_controller_); | 14 DCHECK(bluetooth_chooser_controller_); |
| 14 } | 15 } |
| 15 | 16 |
| 16 BluetoothChooserDesktop::~BluetoothChooserDesktop() { | 17 BluetoothChooserDesktop::~BluetoothChooserDesktop() { |
| 17 // This satisfies the WebContentsDelegate::RunBluetoothChooser() requirement | 18 // This satisfies the WebContentsDelegate::RunBluetoothChooser() requirement |
| 18 // that the EventHandler can be destroyed any time after the BluetoothChooser | 19 // that the EventHandler can be destroyed any time after the BluetoothChooser |
| (...skipping 11 matching lines...) Expand all Loading... |
| 30 | 31 |
| 31 void BluetoothChooserDesktop::AddOrUpdateDevice( | 32 void BluetoothChooserDesktop::AddOrUpdateDevice( |
| 32 const std::string& device_id, | 33 const std::string& device_id, |
| 33 bool should_update_name, | 34 bool should_update_name, |
| 34 const base::string16& device_name, | 35 const base::string16& device_name, |
| 35 bool is_gatt_connected, | 36 bool is_gatt_connected, |
| 36 bool is_paired, | 37 bool is_paired, |
| 37 const int8_t* rssi) { | 38 const int8_t* rssi) { |
| 38 bluetooth_chooser_controller_->AddOrUpdateDevice( | 39 bluetooth_chooser_controller_->AddOrUpdateDevice( |
| 39 device_id, should_update_name, device_name, is_gatt_connected, is_paired, | 40 device_id, should_update_name, device_name, is_gatt_connected, is_paired, |
| 40 rssi); | 41 rssi ? content::BluetoothDeviceChooserController:: |
| 42 CalculateSignalStrengthLevel(*rssi) |
| 43 : -1); |
| 41 } | 44 } |
| 42 | 45 |
| 43 void BluetoothChooserDesktop::RemoveDevice(const std::string& device_id) { | 46 void BluetoothChooserDesktop::RemoveDevice(const std::string& device_id) { |
| 44 bluetooth_chooser_controller_->RemoveDevice(device_id); | 47 bluetooth_chooser_controller_->RemoveDevice(device_id); |
| 45 } | 48 } |
| OLD | NEW |