| 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 "chrome/browser/ui/bluetooth/bluetooth_chooser_bubble_delegate.h" | 7 #include "chrome/browser/ui/bluetooth/bluetooth_chooser_bubble_controller.h" |
| 8 | 8 |
| 9 BluetoothChooserDesktop::BluetoothChooserDesktop( | 9 BluetoothChooserDesktop::BluetoothChooserDesktop( |
| 10 const content::BluetoothChooser::EventHandler& event_handler) | 10 const content::BluetoothChooser::EventHandler& event_handler) |
| 11 : event_handler_(event_handler), | 11 : event_handler_(event_handler), |
| 12 bluetooth_chooser_bubble_delegate_(nullptr) {} | 12 bluetooth_chooser_bubble_controller_(nullptr) {} |
| 13 | 13 |
| 14 BluetoothChooserDesktop::~BluetoothChooserDesktop() { | 14 BluetoothChooserDesktop::~BluetoothChooserDesktop() { |
| 15 if (bluetooth_chooser_bubble_delegate_) | 15 if (bluetooth_chooser_bubble_controller_) |
| 16 bluetooth_chooser_bubble_delegate_->set_bluetooth_chooser(nullptr); | 16 bluetooth_chooser_bubble_controller_->set_bluetooth_chooser(nullptr); |
| 17 } | 17 } |
| 18 | 18 |
| 19 void BluetoothChooserDesktop::SetAdapterPresence(AdapterPresence presence) {} | 19 void BluetoothChooserDesktop::SetAdapterPresence(AdapterPresence presence) {} |
| 20 | 20 |
| 21 void BluetoothChooserDesktop::ShowDiscoveryState(DiscoveryState state) {} | 21 void BluetoothChooserDesktop::ShowDiscoveryState(DiscoveryState state) {} |
| 22 | 22 |
| 23 void BluetoothChooserDesktop::AddDevice(const std::string& device_id, | 23 void BluetoothChooserDesktop::AddDevice(const std::string& device_id, |
| 24 const base::string16& device_name) { | 24 const base::string16& device_name) { |
| 25 if (bluetooth_chooser_bubble_delegate_) | 25 if (bluetooth_chooser_bubble_controller_) |
| 26 bluetooth_chooser_bubble_delegate_->AddDevice(device_id, device_name); | 26 bluetooth_chooser_bubble_controller_->AddDevice(device_id, device_name); |
| 27 } | 27 } |
| 28 | 28 |
| 29 void BluetoothChooserDesktop::RemoveDevice(const std::string& device_id) { | 29 void BluetoothChooserDesktop::RemoveDevice(const std::string& device_id) { |
| 30 if (bluetooth_chooser_bubble_delegate_) | 30 if (bluetooth_chooser_bubble_controller_) |
| 31 bluetooth_chooser_bubble_delegate_->RemoveDevice(device_id); | 31 bluetooth_chooser_bubble_controller_->RemoveDevice(device_id); |
| 32 } | 32 } |
| 33 | 33 |
| 34 void BluetoothChooserDesktop::CallEventHandler( | 34 void BluetoothChooserDesktop::CallEventHandler( |
| 35 content::BluetoothChooser::Event event, | 35 content::BluetoothChooser::Event event, |
| 36 const std::string& device_id) { | 36 const std::string& device_id) { |
| 37 event_handler_.Run(event, device_id); | 37 event_handler_.Run(event, device_id); |
| 38 } | 38 } |
| OLD | NEW |