Commit 8cf6bcf7 authored by Tim Song's avatar Tim Song Committed by Commit Bot

Ash Tray: Do not show "Toggle Bluetooth" in tooltip if the button is disabled.

The Bluetooth FeaturePod button can be disabled in certain cases (e.g. when the
screen is locked) so the current "Toggle Bluetooth" and "Show Bluetooth
settings" tooltips are not appropriate.

BUG=987933

Change-Id: I2d534f3e99525847a1e4164e510996bd90b0a096
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1729565Reviewed-by: default avatarTetsui Ohkubo <tetsui@chromium.org>
Commit-Queue: Tim Song <tengs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683303}
parent 2f664e49
...@@ -144,10 +144,17 @@ void BluetoothFeaturePodController::UpdateButton() { ...@@ -144,10 +144,17 @@ void BluetoothFeaturePodController::UpdateButton() {
void BluetoothFeaturePodController::SetTooltipState( void BluetoothFeaturePodController::SetTooltipState(
const base::string16& tooltip_state) { const base::string16& tooltip_state) {
button_->SetIconTooltip(l10n_util::GetStringFUTF16( if (button_->GetEnabled()) {
IDS_ASH_STATUS_TRAY_BLUETOOTH_TOGGLE_TOOLTIP, tooltip_state)); button_->SetIconTooltip(l10n_util::GetStringFUTF16(
button_->SetLabelTooltip(l10n_util::GetStringFUTF16( IDS_ASH_STATUS_TRAY_BLUETOOTH_TOGGLE_TOOLTIP, tooltip_state));
IDS_ASH_STATUS_TRAY_BLUETOOTH_SETTINGS_TOOLTIP, tooltip_state)); button_->SetLabelTooltip(l10n_util::GetStringFUTF16(
IDS_ASH_STATUS_TRAY_BLUETOOTH_SETTINGS_TOOLTIP, tooltip_state));
} else {
// Do not show "Toggle" text in tooltip when the button is disabled (e.g.
// when the screen is locked or for secondary users).
button_->SetIconTooltip(tooltip_state);
button_->SetLabelTooltip(tooltip_state);
}
} }
void BluetoothFeaturePodController::OnBluetoothSystemStateChanged() { void BluetoothFeaturePodController::OnBluetoothSystemStateChanged() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment