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

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

Issue 197623002: [OriginChip] Show the page info bubble on the location bar icon. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix a post-merge inconsistency Created 6 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 009c85db7fbf1553985ad818f536e5c7cb6db5f7..5fbe9d2cc1832643704867151955a06c2f516291 100644
--- a/chrome/browser/ui/views/location_bar/location_icon_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_icon_view.cc
@@ -37,19 +37,28 @@ bool LocationIconView::OnMousePressed(const ui::MouseEvent& event) {
}
void LocationIconView::OnMouseReleased(const ui::MouseEvent& event) {
- if (!event.IsOnlyMiddleMouseButton() &&
- !chrome::ShouldDisplayOriginChip() &&
- !chrome::ShouldDisplayOriginChipV2())
- page_info_helper_.ProcessEvent(event);
+ if (event.IsOnlyMiddleMouseButton())
+ return;
+ 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 (page_info_helper_.location_bar()->omnibox_view()->IsEditingOrEmpty() ||
+ chrome::ShouldDisplayOriginChip())
+ return;
+
+ page_info_helper_.ProcessEvent(event);
}
void LocationIconView::ShowTooltip(bool show) {
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_icon_view.h ('k') | chrome/browser/ui/views/location_bar/page_info_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698