Commit 65e09363 authored by Tetsui Ohkubo's avatar Tetsui Ohkubo Committed by Commit Bot

Unified: Remove focus from some feature pod labels

Some feature pod buttons have same action for both the icon and the
label. In such case, the label button should not be included in keybaord
focus chain.

TEST=manual
BUG=none

Change-Id: I1e2c87c5bfdc18ce4ca233807e94053313e9830d
Reviewed-on: https://chromium-review.googlesource.com/1152716Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578972}
parent 35be1bb5
......@@ -31,6 +31,7 @@ FeaturePodButton* CastFeaturePodController::CreateButton() {
button_->SetIconAndLabelTooltips(
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_CAST_TOOLTIP));
button_->ShowDetailedViewArrow();
button_->DisableLabelButtonFocus();
button_->set_id(VIEW_ID_CAST_MAIN_VIEW);
Update();
return button_;
......
......@@ -63,6 +63,7 @@ FeaturePodButton* IMEFeaturePodController::CreateButton() {
button_->SetLabel(l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_IME_SHORT));
button_->SetIconAndLabelTooltips(GetTooltipString());
button_->ShowDetailedViewArrow();
button_->DisableLabelButtonFocus();
Update();
return button_;
}
......
......@@ -40,6 +40,7 @@ FeaturePodButton* VPNFeaturePodController::CreateButton() {
button_->SetIconAndLabelTooltips(
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_VPN_TOOLTIP));
button_->ShowDetailedViewArrow();
button_->DisableLabelButtonFocus();
Update();
return button_;
}
......
......@@ -29,6 +29,7 @@ RotationLockFeaturePodController::~RotationLockFeaturePodController() {
FeaturePodButton* RotationLockFeaturePodController::CreateButton() {
DCHECK(!button_);
button_ = new FeaturePodButton(this);
button_->DisableLabelButtonFocus();
UpdateButton();
return button_;
}
......
......@@ -30,6 +30,7 @@ FeaturePodButton* AccessibilityFeaturePodController::CreateButton() {
button->SetIconAndLabelTooltips(
l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_ACCESSIBILITY_TOOLTIP));
button->ShowDetailedViewArrow();
button->DisableLabelButtonFocus();
AccessibilityDelegate* delegate = Shell::Get()->accessibility_delegate();
LoginStatus login_status = Shell::Get()->session_controller()->login_status();
......
......@@ -288,6 +288,10 @@ void FeaturePodButton::ShowDetailedViewArrow() {
label_button_->SchedulePaint();
}
void FeaturePodButton::DisableLabelButtonFocus() {
label_button_->SetFocusBehavior(FocusBehavior::NEVER);
}
void FeaturePodButton::SetToggled(bool toggled) {
icon_button_->SetToggled(toggled);
}
......
......@@ -117,6 +117,10 @@ class ASH_EXPORT FeaturePodButton : public views::View,
// Show arrow to indicate that the feature has a detailed view.
void ShowDetailedViewArrow();
// Remove the label button from keyboard focus chain. This is useful when
// the icon button and the label button has the same action.
void DisableLabelButtonFocus();
// Change the toggled state. If toggled, the background color of the circle
// will change.
void SetToggled(bool toggled);
......
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