Commit a307607c authored by Jimmy Gong's avatar Jimmy Gong Committed by Chromium LUCI CQ

Phone Hub: Add Silence Phone tooltip for disabled view

Screenshot:
https://storage.cloud.google.com/chromium-translation-screenshots/97d2fdaa8a77f2ca60b7059fbd5997de0ba3cbe9?authuser=0

Bug: 1155244
Change-Id: I2c5d902a7a3c8bd5e61c7b3fd4914d852ad8828b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2575205
Commit-Queue: Jimmy Gong <jimmyxgong@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#834453}
parent d3b60c52
......@@ -1204,6 +1204,9 @@ This file contains the strings for ash.
<message name="IDS_ASH_PHONE_HUB_CONNECTED_DEVICE_SETTINGS_LABEL" desc="Label for the settings button in the Phone Hub UI that lets users know that the button routes to the Chrome OS Settings app page for connected devices (e.g. to disable Phone Hub features, enable/disable Smartlock, etc)">
Connected devices settings
</message>
<message name="IDS_ASH_PHONE_HUB_SILENCE_BUTTON_NOT_AVAILABLE_TOOLTIP" translateable="false" desc="Tooltip message that indicates to the user that the Silence Phone feature is disabled because their phone is on a work profile.">
Silence phone is not available on work profile
</message>
<message name="IDS_ASH_STYLUS_TOOLS_CAPTURE_REGION_ACTION" desc="Title of the capture region action in the stylus tools (a pop-up panel next to the status tray). This causes a partial screenshot to be taken (the user selects an area of the screen to take a screenshot of).">
Capture region
......
97d2fdaa8a77f2ca60b7059fbd5997de0ba3cbe9
\ No newline at end of file
......@@ -117,19 +117,22 @@ void SilencePhoneQuickActionController::SetItemState(ActionState state) {
// TODO(1155784): Update disabled view with matching toggle-state colors.
icon_enabled = dnd_controller_->IsDndEnabled();
button_enabled = false;
state_text_id = IDS_ASH_PHONE_HUB_QUICK_ACTIONS_DISABLED_STATE_TOOLTIP;
state_text_id = IDS_ASH_PHONE_HUB_SILENCE_BUTTON_NOT_AVAILABLE_TOOLTIP;
sub_label_text = IDS_ASH_PHONE_HUB_QUICK_ACTIONS_NOT_AVAILABLE_STATE;
}
item_->SetEnabled(button_enabled);
item_->SetToggled(icon_enabled);
item_->SetSubLabel(l10n_util::GetStringUTF16(sub_label_text));
base::string16 tooltip_state =
l10n_util::GetStringFUTF16(state_text_id, item_->GetItemLabel());
item_->SetIconTooltip(
l10n_util::GetStringFUTF16(IDS_ASH_PHONE_HUB_QUICK_ACTIONS_TOGGLE_TOOLTIP,
item_->GetItemLabel(), tooltip_state));
if (state == ActionState::kDisabled) {
item_->SetIconTooltip(l10n_util::GetStringUTF16(state_text_id));
} else {
base::string16 tooltip_state =
l10n_util::GetStringFUTF16(state_text_id, item_->GetItemLabel());
item_->SetIconTooltip(l10n_util::GetStringFUTF16(
IDS_ASH_PHONE_HUB_QUICK_ACTIONS_TOGGLE_TOOLTIP, item_->GetItemLabel(),
tooltip_state));
}
for (auto& observer : observer_list_)
observer.OnSilencePhoneItemStateChanged();
}
......
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