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

Unified Diff: chrome/browser/ui/cocoa/location_bar/location_icon_decoration.mm

Issue 233623002: Shows the info bubble when the location bar icon is clicked in the origin chip. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase. Created 6 years, 7 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/cocoa/location_bar/location_icon_decoration.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/location_icon_decoration.mm b/chrome/browser/ui/cocoa/location_bar/location_icon_decoration.mm
index 389932c8268a7d5acd2824d41f3b73e51dc1c48c..54476d19d598aa949f17670afa8f81d0414a43bd 100644
--- a/chrome/browser/ui/cocoa/location_bar/location_icon_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/location_icon_decoration.mm
@@ -6,6 +6,7 @@
#include "base/strings/sys_string_conversions.h"
#include "chrome/browser/favicon/favicon_tab_helper.h"
+#include "chrome/browser/search/search.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_finder.h"
@@ -94,10 +95,21 @@ bool LocationIconDecoration::AcceptsMousePress() {
return true;
}
-bool LocationIconDecoration::OnMousePressed(NSRect frame) {
+bool LocationIconDecoration::OnMousePressed(NSRect frame, NSPoint location) {
+ // TODO(macourteau): this code (for displaying the page info bubble) should be
+ // pulled out into LocationBarViewMac (or maybe even further), as other
+ // decorations currently depend on this decoration only to show the page info
+ // bubble.
+
// Do not show page info if the user has been editing the location
- // bar, or the location bar is at the NTP.
- if (owner_->GetOmniboxView()->IsEditingOrEmpty())
+ // bar, or the location bar is at the NTP. However, if the origin chip is
+ // enabled, the omnibox will be empty by default, so the page info should be
+ // shown in those cases as well.
+ if ((chrome::ShouldDisplayOriginChipV2() &&
+ owner_->GetOmniboxView()->model() &&
+ owner_->GetOmniboxView()->model()->user_input_in_progress()) ||
+ (!chrome::ShouldDisplayOriginChipV2() &&
+ owner_->GetOmniboxView()->IsEditingOrEmpty()))
return true;
WebContents* tab = owner_->GetWebContents();

Powered by Google App Engine
This is Rietveld 408576698