Commit a07e7f06 authored by Kamila's avatar Kamila Committed by Commit Bot

Highlight indicator as focused, not clicked.

Changes the highlight of the indicator when a promo is shown, to mimic
being focused/hovered rather than clicked.

This is done according to recommendation from UX to achieve a lighter shade
of the background color (promo is showing) in contrast to a darker shade
(when the bubble opens). This change provides the user with subtle visual
feedback.

Bug: 986737
Change-Id: I6238548c74fcb0027c0f9a105fc9c769a23c052a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1948929Reviewed-by: default avatarBalazs Engedy <engedy@chromium.org>
Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
Commit-Queue: Kamila Hasanbega <hkamila@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721084}
parent 9c4c2fb3
...@@ -223,7 +223,7 @@ ContentSettingImageModel::ImageType ContentSettingImageView::GetTypeForTesting() ...@@ -223,7 +223,7 @@ ContentSettingImageModel::ImageType ContentSettingImageView::GetTypeForTesting()
void ContentSettingImageView::OnWidgetDestroying(views::Widget* widget) { void ContentSettingImageView::OnWidgetDestroying(views::Widget* widget) {
if (indicator_promo_ && indicator_promo_->GetWidget() == widget) { if (indicator_promo_ && indicator_promo_->GetWidget() == widget) {
this->SetHighlighted(false); GetInkDrop()->SetFocused(false);
observer_.Remove(widget); observer_.Remove(widget);
indicator_promo_ = nullptr; indicator_promo_ = nullptr;
// The highlighted icon needs to be recolored. // The highlighted icon needs to be recolored.
...@@ -260,7 +260,7 @@ void ContentSettingImageView::AnimationEnded(const gfx::Animation* animation) { ...@@ -260,7 +260,7 @@ void ContentSettingImageView::AnimationEnded(const gfx::Animation* animation) {
base::nullopt, base::nullopt,
std::make_unique<FeaturePromoBubbleTimeout>(base::TimeDelta(), std::make_unique<FeaturePromoBubbleTimeout>(base::TimeDelta(),
base::TimeDelta())); base::TimeDelta()));
this->SetHighlighted(true); GetInkDrop()->SetFocused(true);
observer_.Add(indicator_promo_->GetWidget()); observer_.Add(indicator_promo_->GetWidget());
SchedulePaint(); SchedulePaint();
content_setting_image_model_->SetPromoWasShown(web_contents); content_setting_image_model_->SetPromoWasShown(web_contents);
......
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