Chromium Code Reviews| 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; |
| } |
| } |