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

Side by Side Diff: chrome/browser/cocoa/bookmark_button_cell.mm

Issue 391046: Fix "open all" on a folder node to open only 'marks in that folder,... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/cocoa/bookmark_button_cell.h" 5 #import "chrome/browser/cocoa/bookmark_button_cell.h"
6 #import "chrome/browser/cocoa/bookmark_menu.h"
6 #import "third_party/GTM/AppKit/GTMTheme.h" 7 #import "third_party/GTM/AppKit/GTMTheme.h"
7 8
8 @implementation BookmarkButtonCell 9 @implementation BookmarkButtonCell
9 10
10 - (id)initTextCell:(NSString *)string { 11 - (id)initTextCell:(NSString *)string {
11 if ((self = [super initTextCell:string])) { 12 if ((self = [super initTextCell:string])) {
12 [self setButtonType:NSMomentaryPushInButton]; 13 [self setButtonType:NSMomentaryPushInButton];
13 [self setBezelStyle:NSShadowlessSquareBezelStyle]; 14 [self setBezelStyle:NSShadowlessSquareBezelStyle];
14 [self setShowsBorderOnlyWhileMouseInside:YES]; 15 [self setShowsBorderOnlyWhileMouseInside:YES];
15 [self setControlSize:NSSmallControlSize]; 16 [self setControlSize:NSSmallControlSize];
(...skipping 30 matching lines...) Expand all
46 [self setImagePosition:NSImageOnly]; 47 [self setImagePosition:NSImageOnly];
47 } else { 48 } else {
48 [self setImagePosition:NSImageLeft]; 49 [self setImagePosition:NSImageLeft];
49 } 50 }
50 } 51 }
51 [self setTitle:title]; 52 [self setTitle:title];
52 } 53 }
53 54
54 // We share the context menu among all bookmark buttons. To allow us 55 // We share the context menu among all bookmark buttons. To allow us
55 // to disambiguate when needed (e.g. "open bookmark"), we set the 56 // to disambiguate when needed (e.g. "open bookmark"), we set the
56 // menu's delegate to be us. We (the cell) have the bookmark encoded 57 // menu's associated node to be our represented object.
57 // in our represented object.
58 // Convention needed in -[BookmarkBarController openBookmarkIn***] calls.
59 - (NSMenu*)menu { 58 - (NSMenu*)menu {
60 NSMenu* menu = [super menu]; 59 BookmarkMenu* menu = (BookmarkMenu*)[super menu];
61 [menu setDelegate:self]; 60 [menu setRepresentedObject:[self representedObject]];
62 return menu; 61 return menu;
63 } 62 }
64 63
65 @end 64 @end
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/bookmark_bar_controller_unittest.mm ('k') | chrome/browser/cocoa/bookmark_button_cell_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698