1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_STAR_DECORATION_H_
6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_STAR_DECORATION_H_
8 #import <Cocoa/Cocoa.h>
10 #include "chrome/browser/ui/cocoa/location_bar/image_decoration.h"
14 // Star icon on the right side of the field.
16 class StarDecoration
: public ImageDecoration
{
18 explicit StarDecoration(CommandUpdater
* command_updater
);
19 virtual ~StarDecoration();
21 // Sets the image and tooltip based on |starred|.
22 void SetStarred(bool starred
);
24 // Returns true if the star is lit.
25 bool starred() const { return starred_
; }
27 // Get the point where the bookmark bubble should point within the
28 // decoration's frame.
29 NSPoint
GetBubblePointInFrame(NSRect frame
);
31 // Implement |LocationBarDecoration|.
32 virtual bool AcceptsMousePress() OVERRIDE
;
33 virtual bool OnMousePressed(NSRect frame
) OVERRIDE
;
34 virtual NSString
* GetToolTip() OVERRIDE
;
37 // For bringing up bookmark bar.
38 CommandUpdater
* command_updater_
; // Weak, owned by Browser.
40 // The string to show for a tooltip.
41 base::scoped_nsobject
<NSString
> tooltip_
;
43 // Whether the star icon is lit.
46 DISALLOW_COPY_AND_ASSIGN(StarDecoration
);
49 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_STAR_DECORATION_H_