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

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

Issue 2720183002: [Views] Update ink drop for omnibox icons (Closed)
Patch Set: Update the behavior Created 3 years, 9 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 6ea7d207c236b6a8cce42dd77831c9749266633d..52eec3c960049f2ee17be694067b30aa63c54c45 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
@@ -81,8 +81,8 @@ void ContentSettingImageView::Update(content::WebContents* web_contents) {
// the user. If this becomes a problem, we could design some sort of queueing
// mechanism to show one after the other, but it doesn't seem important now.
int string_id = content_setting_image_model_->explanatory_string_id();
+ AnimateInkDrop(views::InkDropState::HIDDEN, nullptr /* event */);
if (string_id && !label()->visible()) {
- AnimateInkDrop(views::InkDropState::HIDDEN, nullptr /* event */);
SetLabel(l10n_util::GetStringUTF16(string_id));
label()->SetVisible(true);
slide_animator_.Show();
@@ -95,6 +95,10 @@ const char* ContentSettingImageView::GetClassName() const {
return "ContentSettingsImageView";
}
+bool ContentSettingImageView::IsInkDropEnabled() const {
+ return true;
+}
+
void ContentSettingImageView::OnBoundsChanged(
const gfx::Rect& previous_bounds) {
if (bubble_view_)
@@ -104,8 +108,8 @@ void ContentSettingImageView::OnBoundsChanged(
bool ContentSettingImageView::OnMousePressed(const ui::MouseEvent& event) {
// If the bubble is showing then don't reshow it when the mouse is released.
suppress_mouse_released_action_ = bubble_view_ != nullptr;
- if (!suppress_mouse_released_action_ && !label()->visible())
- AnimateInkDrop(views::InkDropState::ACTION_PENDING, &event);
+ if (!suppress_mouse_released_action_)
+ IconLabelBubbleView::OnMousePressed(event);
// We want to show the bubble on mouse release; that is the standard behavior
// for buttons.
@@ -121,7 +125,7 @@ void ContentSettingImageView::OnMouseReleased(const ui::MouseEvent& event) {
return;
}
const bool activated = HitTestPoint(event.location());
- if (!label()->visible() && !activated)
+ if (!activated)
AnimateInkDrop(views::InkDropState::HIDDEN, &event);
if (activated)
OnActivate(event);
@@ -147,12 +151,6 @@ void ContentSettingImageView::OnNativeThemeChanged(
IconLabelBubbleView::OnNativeThemeChanged(native_theme);
}
-std::unique_ptr<views::InkDrop> ContentSettingImageView::CreateInkDrop() {
- std::unique_ptr<views::InkDropImpl> ink_drop = CreateDefaultInkDropImpl();
- ink_drop->SetShowHighlightOnFocus(true);
- return std::move(ink_drop);
-}
-
SkColor ContentSettingImageView::GetTextColor() const {
return GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_TextfieldDefaultColor);
@@ -271,7 +269,7 @@ void ContentSettingImageView::OnWidgetDestroying(views::Widget* widget) {
void ContentSettingImageView::OnWidgetVisibilityChanged(views::Widget* widget,
bool visible) {
// |widget| is a bubble that has just got shown / hidden.
- if (!visible && !label()->visible())
+ if (!visible)
AnimateInkDrop(views::InkDropState::DEACTIVATED, nullptr /* event */);
}

Powered by Google App Engine
This is Rietveld 408576698