Chromium Code Reviews| 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..405260885719a6caa46d6109276193d1866aab07 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,17 +27,22 @@ 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. |
| void Update(); |
| + // Implement |ButtonDecoration|. |
| + virtual bool PreventFocus(NSPoint location) const OVERRIDE; |
| + |
| // Implement |LocationBarDecoration|. |
| 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( |
| @@ -49,9 +55,6 @@ class OriginChipDecoration : public ButtonDecoration, |
| const SafeBrowsingUIManager::UnsafeResource& resource) OVERRIDE; |
| private: |
| - // Returns whether the origin chip should be shown or not. |
| - bool ShouldShow() const; |
| - |
| // Contains attributes for drawing the origin string. |
| base::scoped_nsobject<NSMutableDictionary> attributes_; |
| @@ -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_; |
|
Scott Hess - ex-Googler
2014/05/08 23:00:47
This dependency ever-so-slightly concerns me. I c
groby-ooo-7-16
2014/05/08 23:14:07
I made the same point further up - search for "I'm
Scott Hess - ex-Googler
2014/05/08 23:21:36
I think my overall goal would be to make sure thin
macourteau
2014/05/09 14:00:27
Yes, I agree. There's a TODO in LocationIconDecora
|
| + |
| // The control view that owns this. Weak. |
| LocationBarViewMac* owner_; |