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

Unified Diff: chrome/browser/ui/cocoa/location_bar/origin_chip_decoration.h

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: Comment tweaks. Created 6 years, 8 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/origin_chip_decoration.h
diff --git a/chrome/browser/ui/cocoa/location_bar/origin_chip_decoration.h b/chrome/browser/ui/cocoa/location_bar/origin_chip_decoration.h
index 2b0fee9974a9b194970cb5bfe697094b6a856442..e05c2886f2d8fc0dc3159c8dcb2ccd2d2a666bdd 100644
--- a/chrome/browser/ui/cocoa/location_bar/origin_chip_decoration.h
+++ b/chrome/browser/ui/cocoa/location_bar/origin_chip_decoration.h
@@ -14,6 +14,7 @@
#include "chrome/browser/ui/toolbar/origin_chip_info.h"
class LocationBarViewMac;
+class LocationIconDecoration;
namespace content {
class WebContents;
@@ -26,7 +27,8 @@ class OriginChipDecoration : public ButtonDecoration,
public extensions::IconImage::Observer,
public SafeBrowsingUIManager::Observer {
public:
- explicit OriginChipDecoration(LocationBarViewMac* owner);
+ OriginChipDecoration(LocationBarViewMac* owner,
+ LocationIconDecoration* location_icon);
virtual ~OriginChipDecoration();
// Updates the origin chip's content, and display state.
@@ -36,7 +38,8 @@ class OriginChipDecoration : public ButtonDecoration,
virtual CGFloat GetWidthForSpace(CGFloat width) OVERRIDE;
virtual void DrawInFrame(NSRect frame, NSView* control_view) OVERRIDE;
virtual NSString* GetToolTip() OVERRIDE;
- virtual bool OnMousePressed(NSRect frame) OVERRIDE;
+ virtual bool OnMousePressed(NSRect frame, NSPoint location) OVERRIDE;
+ virtual NSPoint GetBubblePointInFrame(NSRect frame) OVERRIDE;
// Implement |IconImage::Observer|.
virtual void OnExtensionIconImageChanged(
@@ -59,12 +62,19 @@ class OriginChipDecoration : public ButtonDecoration,
// extension.
base::scoped_nsobject<NSImage> extension_icon_;
+ // The rectangle where the icon was last drawn. Used for hit testing to
+ // display the permissions bubble.
+ NSRect icon_rect_;
+
// Manages information to be displayed on the origin chip.
OriginChipInfo info_;
// The label currently displayed in the chip.
base::scoped_nsobject<NSString> label_;
+ // The location icon decoration. Weak.
+ LocationIconDecoration* location_icon_;
+
// The control view that owns this. Weak.
LocationBarViewMac* owner_;

Powered by Google App Engine
This is Rietveld 408576698