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

Unified Diff: chrome/browser/ui/views/location_bar/location_icon_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/location_icon_view.cc
diff --git a/chrome/browser/ui/views/location_bar/location_icon_view.cc b/chrome/browser/ui/views/location_bar/location_icon_view.cc
index d388e2fa9b8f2eb769d3cfd2b20393d15a02ba67..a46ea95f9c5b41250e43b754d29bbaf97c62826a 100644
--- a/chrome/browser/ui/views/location_bar/location_icon_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_icon_view.cc
@@ -13,6 +13,7 @@
#include "components/omnibox/browser/omnibox_edit_model.h"
#include "content/public/browser/web_contents.h"
#include "ui/base/l10n/l10n_util.h"
+#include "ui/views/animation/ink_drop_impl.h"
#include "ui/views/controls/label.h"
using content::WebContents;
@@ -24,6 +25,7 @@ LocationIconView::LocationIconView(const gfx::FontList& font_list,
location_bar_(location_bar),
animation_(this) {
set_id(VIEW_ID_LOCATION_ICON);
+ SetInkDropMode(InkDropMode::ON);
#if defined(OS_MACOSX)
SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY);
@@ -37,6 +39,10 @@ LocationIconView::LocationIconView(const gfx::FontList& font_list,
LocationIconView::~LocationIconView() {
}
+bool LocationIconView::IsInkDropEnabled() const {
+ return !location_bar_->GetOmniboxView()->IsEditingOrEmpty();
+}
+
gfx::Size LocationIconView::GetMinimumSize() const {
return GetMinimumSizeForPreferredSize(GetPreferredSize());
}
@@ -56,6 +62,10 @@ bool LocationIconView::OnMousePressed(const ui::MouseEvent& event) {
suppress_mouse_released_action_ =
WebsiteSettingsPopupView::GetShownPopupType() !=
WebsiteSettingsPopupView::POPUP_NONE;
+
+ if (!suppress_mouse_released_action_)
+ IconLabelBubbleView::OnMousePressed(event);
+
return true;
}
@@ -77,6 +87,7 @@ void LocationIconView::OnMouseReleased(const ui::MouseEvent& event) {
}
OnClickOrTap(event);
+ IconLabelBubbleView::OnMouseReleased(event);
}
void LocationIconView::OnGestureEvent(ui::GestureEvent* event) {

Powered by Google App Engine
This is Rietveld 408576698