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

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

Issue 2163683005: Change ChooserController::Observer to ChooserController::View (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changed ChooserController::Observer to ChooserController::View Created 4 years, 5 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
Index: chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc
diff --git a/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc b/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc
index 7005be741f9c8b1d722f38d791d3297b4794720b..54ed64d16931887c07625996f41e3e3044a5f0be 100644
--- a/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc
+++ b/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc
@@ -107,8 +107,8 @@ void BluetoothChooserController::OnAdapterPresenceChanged(
no_devices_text_ =
l10n_util::GetStringUTF16(IDS_BLUETOOTH_DEVICE_CHOOSER_ADAPTER_OFF);
status_text_ = base::string16();
- if (observer())
- observer()->OnAdapterEnabledChanged(
+ if (view())
msw 2016/07/20 20:37:07 nit: for each of these multi-line conditional bloc
juncai 2016/07/20 22:37:45 Done.
+ view()->OnAdapterEnabledChanged(
false /* Bluetooth adapter is turned off */);
break;
case content::BluetoothChooser::AdapterPresence::POWERED_ON:
@@ -116,8 +116,8 @@ void BluetoothChooserController::OnAdapterPresenceChanged(
l10n_util::GetStringUTF16(IDS_DEVICE_CHOOSER_NO_DEVICES_FOUND_PROMPT);
status_text_ =
l10n_util::GetStringUTF16(IDS_BLUETOOTH_DEVICE_CHOOSER_RE_SCAN);
- if (observer())
- observer()->OnAdapterEnabledChanged(
+ if (view())
+ view()->OnAdapterEnabledChanged(
true /* Bluetooth adapter is turned on */);
break;
}
@@ -129,16 +129,16 @@ void BluetoothChooserController::OnDiscoveryStateChanged(
case content::BluetoothChooser::DiscoveryState::DISCOVERING:
status_text_ =
l10n_util::GetStringUTF16(IDS_BLUETOOTH_DEVICE_CHOOSER_SCANNING);
- if (observer())
- observer()->OnRefreshStateChanged(
+ if (view())
+ view()->OnRefreshStateChanged(
true /* Refreshing options is in progress */);
break;
case content::BluetoothChooser::DiscoveryState::IDLE:
case content::BluetoothChooser::DiscoveryState::FAILED_TO_START:
status_text_ =
l10n_util::GetStringUTF16(IDS_BLUETOOTH_DEVICE_CHOOSER_RE_SCAN);
- if (observer())
- observer()->OnRefreshStateChanged(
+ if (view())
+ view()->OnRefreshStateChanged(
false /* Refreshing options is complete */);
break;
}
@@ -148,8 +148,8 @@ void BluetoothChooserController::AddDevice(const std::string& device_id,
const base::string16& device_name) {
device_names_and_ids_.push_back(std::make_pair(device_name, device_id));
++device_name_map_[device_name];
- if (observer())
- observer()->OnOptionAdded(device_names_and_ids_.size() - 1);
+ if (view())
+ view()->OnOptionAdded(device_names_and_ids_.size() - 1);
}
void BluetoothChooserController::RemoveDevice(const std::string& device_id) {
@@ -161,8 +161,8 @@ void BluetoothChooserController::RemoveDevice(const std::string& device_id) {
if (--device_name_map_[it->first] == 0)
device_name_map_.erase(it->first);
device_names_and_ids_.erase(it);
- if (observer())
- observer()->OnOptionRemoved(index);
+ if (view())
+ view()->OnOptionRemoved(index);
return;
}
}

Powered by Google App Engine
This is Rietveld 408576698