Chromium Code Reviews| Index: chrome/browser/ui/cocoa/location_bar/zoom_decoration.h |
| diff --git a/chrome/browser/ui/cocoa/location_bar/zoom_decoration.h b/chrome/browser/ui/cocoa/location_bar/zoom_decoration.h |
| index 9e26e8f9ac57e329173c6d2438a78ef8a84bdd52..2bf9a29d0252f12e7fbe05b1e28ad7db2a927570 100644 |
| --- a/chrome/browser/ui/cocoa/location_bar/zoom_decoration.h |
| +++ b/chrome/browser/ui/cocoa/location_bar/zoom_decoration.h |
| @@ -10,15 +10,15 @@ |
| #include "base/basictypes.h" |
| #include "chrome/browser/ui/cocoa/location_bar/image_decoration.h" |
| -class ToolbarModel; |
| +class LocationBarViewMac; |
| +@class ZoomBubbleController; |
| class ZoomController; |
| // Zoom icon at the end of the omnibox (close to page actions) when at a |
| // non-standard zoom level. |
| -// TODO(dbeam): add mouse event handlers to show a zoom bubble on click. |
| class ZoomDecoration : public ImageDecoration { |
| public: |
| - explicit ZoomDecoration(ToolbarModel* toolbar_model); |
| + explicit ZoomDecoration(LocationBarViewMac* owner); |
| virtual ~ZoomDecoration(); |
| // Called when this decoration should show or hide itself in its most current |
| @@ -26,13 +26,18 @@ class ZoomDecoration : public ImageDecoration { |
| void Update(ZoomController* zoom_controller); |
| private: |
| + NSPoint GetBubblePointInFrame(NSRect frame); |
| + |
| // LocationBarDecoration implementation. |
| virtual bool AcceptsMousePress() OVERRIDE; |
| + virtual bool OnMousePressed(NSRect frame) OVERRIDE; |
| virtual NSString* GetToolTip() OVERRIDE; |
| - // A reference to the toolbar model to query whether input is currently |
| - // happening in the location bar. Not owned by this class. |
| - ToolbarModel* toolbar_model_; |
| + // The control that owns this. Weak. |
| + LocationBarViewMac* owner_; |
| + |
| + // The bubble that this decoration shows. Weak, owns self. |
|
sail
2013/02/15 21:05:12
In a different review thakis recommended using a s
Robert Sesek
2013/02/15 21:39:20
I wrote it like that earlier but the closeObserver
sail
2013/02/15 21:58:20
It should still be easy to test. In closeObserver
|
| + ZoomBubbleController* bubble_; |
| // The string to show for a tooltip. |
| scoped_nsobject<NSString> tooltip_; |