Commit ab4b1b85 authored by Meilin Wang's avatar Meilin Wang Committed by Commit Bot

[CrOS PhoneHub] Fix Dimiss button not focus traversable.

Previously the Dismiss button on notification opt in view is not
focus traversable when navigating through the tab key. This CL fixes
this issue by replacing it with the existing |InterstitialViewButton|
which is focusable by default and shares the common setup of system menu
buttons.

Screenshot: https://screenshot.googleplex.com/4qjFN3Aqm9rKENp.png

BUG=1106937,1126208

Change-Id: I12da67a65f064793322628c5bb5a5ea1f45dee43
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2466977Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Reviewed-by: default avatarTim Song <tengs@chromium.org>
Commit-Queue: Meilin Wang <meilinw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#816783}
parent 935eba85
......@@ -9,6 +9,7 @@
#include "ash/public/cpp/new_window_delegate.h"
#include "ash/strings/grit/ash_strings.h"
#include "ash/style/ash_color_provider.h"
#include "ash/system/phonehub/interstitial_view_button.h"
#include "ash/system/phonehub/phone_hub_view_ids.h"
#include "ash/system/tray/tray_bubble_view.h"
#include "ash/system/tray/tray_popup_item_style.h"
......@@ -111,17 +112,21 @@ void NotificationOptInView::InitLayout() {
button_container->SetBorder(
views::CreateEmptyBorder(kButtonContainerBorderInsets));
dismiss_button_ =
button_container->AddChildView(std::make_unique<views::LabelButton>(
this, l10n_util::GetStringUTF16(
IDS_ASH_PHONE_HUB_NOTIFICATION_OPT_IN_DISMISS_BUTTON)));
button_container->AddChildView(std::make_unique<InterstitialViewButton>(
this,
l10n_util::GetStringUTF16(
IDS_ASH_PHONE_HUB_NOTIFICATION_OPT_IN_DISMISS_BUTTON),
/*paint_background=*/false));
dismiss_button_->set_tag(kDismissButtonTag);
dismiss_button_->SetEnabledTextColors(
AshColorProvider::Get()->GetContentLayerColor(
AshColorProvider::ContentLayerType::kTextColorPrimary));
set_up_button_ =
button_container->AddChildView(std::make_unique<RoundedLabelButton>(
this, l10n_util::GetStringUTF16(
IDS_ASH_PHONE_HUB_NOTIFICATION_OPT_IN_SET_UP_BUTTON)));
button_container->AddChildView(std::make_unique<InterstitialViewButton>(
this,
l10n_util::GetStringUTF16(
IDS_ASH_PHONE_HUB_NOTIFICATION_OPT_IN_SET_UP_BUTTON),
/*paint_background=*/true));
set_up_button_->set_tag(kSetUpButtonTag);
}
......
......@@ -6,6 +6,7 @@
#define ASH_SYSTEM_PHONEHUB_NOTIFICATION_OPT_IN_VIEW_H_
#include "ash/ash_export.h"
#include "ash/system/phonehub/interstitial_view_button.h"
#include "ash/system/unified/rounded_label_button.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/metadata/metadata_header_macros.h"
......@@ -13,7 +14,6 @@
namespace views {
class Label;
class LabelButton;
} // namespace views
namespace ash {
......@@ -43,8 +43,8 @@ class ASH_EXPORT NotificationOptInView : public views::View,
// Main components of this view. Owned by view hierarchy.
views::Label* text_label_ = nullptr;
RoundedLabelButton* set_up_button_ = nullptr;
views::LabelButton* dismiss_button_ = nullptr;
InterstitialViewButton* set_up_button_ = nullptr;
InterstitialViewButton* dismiss_button_ = nullptr;
TrayBubbleView* bubble_view_ = nullptr;
};
......
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