Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3463)

Unified Diff: chrome/browser/ui/views/location_bar/content_setting_image_view.cc

Issue 2098643002: Add ink drop highlight for hover and focus on location icons (e.g. star, (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: docs Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/location_bar/content_setting_image_view.cc
diff --git a/chrome/browser/ui/views/location_bar/content_setting_image_view.cc b/chrome/browser/ui/views/location_bar/content_setting_image_view.cc
index f65691836bf60cff844d86cc35e81cfadbc2bd68..4387f0ebf36d4dce437986745f18c83907899de3 100644
--- a/chrome/browser/ui/views/location_bar/content_setting_image_view.cc
+++ b/chrome/browser/ui/views/location_bar/content_setting_image_view.cc
@@ -47,18 +47,19 @@ ContentSettingImageView::ContentSettingImageView(
suppress_mouse_released_action_(false) {
if (ui::MaterialDesignController::IsModeMaterial()) {
SetHasInkDrop(true);
+ SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY);
} else {
static const int kBackgroundImages[] =
IMAGE_GRID(IDR_OMNIBOX_CONTENT_SETTING_BUBBLE);
SetBackgroundImageGrid(kBackgroundImages);
+ image()->set_interactive(true);
+ image()->SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY);
}
image()->SetHorizontalAlignment(base::i18n::IsRTL()
? views::ImageView::TRAILING
: views::ImageView::LEADING);
- image()->set_interactive(true);
image()->EnableCanvasFlippingForRTLUI(true);
- image()->SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY);
label()->SetElideBehavior(gfx::NO_ELIDE);
label()->SetVisible(false);
@@ -155,6 +156,10 @@ void ContentSettingImageView::OnNativeThemeChanged(
IconLabelBubbleView::OnNativeThemeChanged(native_theme);
}
+bool ContentSettingImageView::ShouldShowInkDropForFocus() const {
+ return true;
+}
+
SkColor ContentSettingImageView::GetTextColor() const {
return GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_TextfieldDefaultColor);

Powered by Google App Engine
This is Rietveld 408576698