From 93ca8ed5063f03b0b8c0745a33080a5b9c43b19e Mon Sep 17 00:00:00 2001 From: "pinkerton@chromium.org" Date: Tue, 17 Feb 2009 14:45:03 +0000 Subject: Implement SetStarredState on LocationBar for Mac. Review URL: http://codereview.chromium.org/21317 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9874 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/cocoa/tab_contents_controller.mm | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'chrome/browser/cocoa/tab_contents_controller.mm') diff --git a/chrome/browser/cocoa/tab_contents_controller.mm b/chrome/browser/cocoa/tab_contents_controller.mm index 83d9c7d..b338745 100644 --- a/chrome/browser/cocoa/tab_contents_controller.mm +++ b/chrome/browser/cocoa/tab_contents_controller.mm @@ -12,6 +12,10 @@ // For now, tab_contents lives here. TODO(port):fix #include "chrome/common/temp_scaffolding_stubs.h" +// Names of images in the bundle for the star icon (normal and 'starred'). +static NSString* const kStarImageName = @"star"; +static NSString* const kStarredImageName = @"starred"; + @interface TabContentsController(CommandUpdates) - (void)enabledStateChangedForCommand:(NSInteger)command enabled:(BOOL)enabled; @end @@ -186,6 +190,13 @@ class LocationBarBridge : public LocationBar { } } +- (void)setStarredState:(BOOL)isStarred { + NSString* starImageName = kStarImageName; + if (isStarred) + starImageName = kStarredImageName; + [starButton_ setImage:[NSImage imageNamed:starImageName]]; +} + @end //-------------------------------------------------------------------------- -- cgit v1.1