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

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

Issue 12286006: [Mac] Implement the basic zoom bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Auto-close bubble Created 7 years, 10 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/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..bc70f83d159bb84e02404dca5da495c8918b296f 100644
--- a/chrome/browser/ui/cocoa/location_bar/zoom_decoration.h
+++ b/chrome/browser/ui/cocoa/location_bar/zoom_decoration.h
@@ -10,29 +10,38 @@
#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
// state.
void Update(ZoomController* zoom_controller);
+ // Shows the zoom bubble for this decoration. If |auto_close| is YES, then
+ // the bubble will automatically close after a fixed period of time.
+ void ShowBubble(BOOL auto_close);
+
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.
+ ZoomBubbleController* bubble_;
// The string to show for a tooltip.
scoped_nsobject<NSString> tooltip_;
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm ('k') | chrome/browser/ui/cocoa/location_bar/zoom_decoration.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698