| 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 9ac13a34f6a2cbb9adc4ce8a1b2fd5ec5110a84a..64171e23cbfe5fcd597efd4d0b6189a44733181b 100644
|
| --- a/chrome/browser/ui/views/location_bar/location_icon_view.cc
|
| +++ b/chrome/browser/ui/views/location_bar/location_icon_view.cc
|
| @@ -11,7 +11,8 @@
|
| #include "ui/base/l10n/l10n_util.h"
|
|
|
| LocationIconView::LocationIconView(LocationBarView* location_bar)
|
| - : page_info_helper_(this, location_bar) {
|
| + : page_info_helper_(this, location_bar),
|
| + location_bar_(location_bar) {
|
| SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_LOCATION_ICON));
|
| LocationBarView::InitTouchableLocationBarChildView(this);
|
| }
|
| @@ -26,18 +27,26 @@ bool LocationIconView::OnMousePressed(const ui::MouseEvent& event) {
|
| }
|
|
|
| void LocationIconView::OnMouseReleased(const ui::MouseEvent& event) {
|
| - if (!chrome::ShouldDisplayOriginChip() &&
|
| - !chrome::ShouldDisplayOriginChipV2())
|
| - page_info_helper_.ProcessEvent(event);
|
| + OnClickOrTap(event);
|
| }
|
|
|
| void LocationIconView::OnGestureEvent(ui::GestureEvent* event) {
|
| - if (!chrome::ShouldDisplayOriginChip() &&
|
| - !chrome::ShouldDisplayOriginChipV2() &&
|
| - (event->type() == ui::ET_GESTURE_TAP)) {
|
| - page_info_helper_.ProcessEvent(*event);
|
| - event->SetHandled();
|
| - }
|
| + if (event->type() != ui::ET_GESTURE_TAP)
|
| + return;
|
| + OnClickOrTap(*event);
|
| + event->SetHandled();
|
| +}
|
| +
|
| +void LocationIconView::OnClickOrTap(const ui::LocatedEvent& event) {
|
| + // Do not show page info if the user has been editing the location bar or the
|
| + // location bar is at the NTP. Also skip showing the page info if the
|
| + // toolbar-based origin chip is being shown because it is responsible for
|
| + // showing the page info instead.
|
| + if (location_bar_->GetOmniboxView()->IsEditingOrEmpty() ||
|
| + chrome::ShouldDisplayOriginChip())
|
| + return;
|
| +
|
| + page_info_helper_.ProcessEvent(event);
|
| }
|
|
|
| void LocationIconView::ShowTooltip(bool show) {
|
|
|