summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/bookmark_button_cell.mm
diff options
context:
space:
mode:
authormrossetti@chromium.org <mrossetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-02 19:36:20 +0000
committermrossetti@chromium.org <mrossetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-02 19:36:20 +0000
commit0645da53f77955736a4b4c7a073fcc9605dcfc1e (patch)
tree44b6df23eeaef423e5b7bf44a8646ba36b7d3aa2 /chrome/browser/cocoa/bookmark_button_cell.mm
parent511cc0d4031024b45c1eb97ae6971217f2ef5994 (diff)
downloadchromium_src-0645da53f77955736a4b4c7a073fcc9605dcfc1e.zip
chromium_src-0645da53f77955736a4b4c7a073fcc9605dcfc1e.tar.gz
chromium_src-0645da53f77955736a4b4c7a073fcc9605dcfc1e.tar.bz2
Remove the themeing from the folder menu background, text in the folder menu items, and no longer needed calls. Changed the menu button stroke color to a lighter shade of black. Did a bit of refactoring of how bookmark buttons are created.
BUG=39428 TEST=Pop up a folder menu and insure that the background does not adopt any theme settings. Review URL: http://codereview.chromium.org/1589005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43511 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/bookmark_button_cell.mm')
-rw-r--r--chrome/browser/cocoa/bookmark_button_cell.mm42
1 files changed, 39 insertions, 3 deletions
diff --git a/chrome/browser/cocoa/bookmark_button_cell.mm b/chrome/browser/cocoa/bookmark_button_cell.mm
index 7125a5c..f769938 100644
--- a/chrome/browser/cocoa/bookmark_button_cell.mm
+++ b/chrome/browser/cocoa/bookmark_button_cell.mm
@@ -2,10 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#import "chrome/browser/cocoa/bookmark_button_cell.h"
+
+#include "app/l10n_util_mac.h"
#include "base/logging.h"
+#include "base/sys_string_conversions.h"
#import "chrome/browser/bookmarks/bookmark_model.h"
-#import "chrome/browser/cocoa/bookmark_button_cell.h"
#import "chrome/browser/cocoa/bookmark_menu.h"
+#include "grit/generated_resources.h"
@interface BookmarkButtonCell(Private)
@@ -17,13 +21,45 @@
@synthesize startingChildIndex = startingChildIndex_;
-- (id)initTextCell:(NSString*)string {
- if ((self = [super initTextCell:string])) {
++ (id)buttonCellForNode:(const BookmarkNode*)node
+ contextMenu:(NSMenu*)contextMenu
+ cellText:(NSString*)cellText
+ cellImage:(NSImage*)cellImage {
+ id buttonCell =
+ [[[BookmarkButtonCell alloc] initForNode:node
+ contextMenu:contextMenu
+ cellText:cellText
+ cellImage:cellImage]
+ autorelease];
+ return buttonCell;
+}
+
+- (id)initForNode:(const BookmarkNode*)node
+ contextMenu:(NSMenu*)contextMenu
+ cellText:(NSString*)cellText
+ cellImage:(NSImage*)cellImage {
+ if ((self = [super initTextCell:cellText])) {
[self configureBookmarkButtonCell];
+
+ [self setBookmarkNode:node];
+
+ if (node) {
+ NSString* title = base::SysWideToNSString(node->GetTitle());
+ [self setBookmarkCellText:title image:cellImage];
+ [self setMenu:contextMenu];
+ } else {
+ [self setEmpty:YES];
+ [self setBookmarkCellText:l10n_util::GetNSString(IDS_MENU_EMPTY_SUBMENU)
+ image:nil];
+ }
}
return self;
}
+- (id)initTextCell:(NSString*)string {
+ return [self initForNode:nil contextMenu:nil cellText:string cellImage:nil];
+}
+
// Used by the off-the-side menu, the only case where a
// BookmarkButtonCell is loaded from a nib.
- (void)awakeFromNib {