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

Unified Diff: chrome/browser/ui/bluetooth/bluetooth_chooser_desktop.cc

Issue 1984923002: Refactor ChooserBubbleController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/bluetooth/bluetooth_chooser_desktop.h ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/bluetooth/bluetooth_chooser_desktop.cc
diff --git a/chrome/browser/ui/bluetooth/bluetooth_chooser_desktop.cc b/chrome/browser/ui/bluetooth/bluetooth_chooser_desktop.cc
index b014048ceed2dc8a630baaa1ac13740d79b3d084..d500dfb0bde1095d768d6f9ddc9881871841db24 100644
--- a/chrome/browser/ui/bluetooth/bluetooth_chooser_desktop.cc
+++ b/chrome/browser/ui/bluetooth/bluetooth_chooser_desktop.cc
@@ -4,35 +4,26 @@
#include "chrome/browser/ui/bluetooth/bluetooth_chooser_desktop.h"
-#include "chrome/browser/ui/bluetooth/bluetooth_chooser_bubble_controller.h"
+#include "base/logging.h"
+#include "chrome/browser/ui/bluetooth/bluetooth_chooser_controller.h"
BluetoothChooserDesktop::BluetoothChooserDesktop(
- const content::BluetoothChooser::EventHandler& event_handler)
- : event_handler_(event_handler),
- bluetooth_chooser_bubble_controller_(nullptr) {}
-
-BluetoothChooserDesktop::~BluetoothChooserDesktop() {
- if (bluetooth_chooser_bubble_controller_)
- bluetooth_chooser_bubble_controller_->set_bluetooth_chooser(nullptr);
+ BluetoothChooserController* bluetooth_chooser_controller)
+ : bluetooth_chooser_controller_(bluetooth_chooser_controller) {
+ DCHECK(bluetooth_chooser_controller_);
}
+BluetoothChooserDesktop::~BluetoothChooserDesktop() {}
+
void BluetoothChooserDesktop::SetAdapterPresence(AdapterPresence presence) {}
void BluetoothChooserDesktop::ShowDiscoveryState(DiscoveryState state) {}
void BluetoothChooserDesktop::AddDevice(const std::string& device_id,
const base::string16& device_name) {
- if (bluetooth_chooser_bubble_controller_)
- bluetooth_chooser_bubble_controller_->AddDevice(device_id, device_name);
+ bluetooth_chooser_controller_->AddDevice(device_id, device_name);
}
void BluetoothChooserDesktop::RemoveDevice(const std::string& device_id) {
- if (bluetooth_chooser_bubble_controller_)
- bluetooth_chooser_bubble_controller_->RemoveDevice(device_id);
-}
-
-void BluetoothChooserDesktop::CallEventHandler(
- content::BluetoothChooser::Event event,
- const std::string& device_id) {
- event_handler_.Run(event, device_id);
+ bluetooth_chooser_controller_->RemoveDevice(device_id);
}
« no previous file with comments | « chrome/browser/ui/bluetooth/bluetooth_chooser_desktop.h ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698