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

Unified Diff: chrome/browser/cocoa/bookmark_bar_controller.h

Issue 159286: Added menus for bookmark bar folders. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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
« no previous file with comments | « chrome/app/nibs/BookmarkBar.xib ('k') | chrome/browser/cocoa/bookmark_bar_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/bookmark_bar_controller.h
===================================================================
--- chrome/browser/cocoa/bookmark_bar_controller.h (revision 21293)
+++ chrome/browser/cocoa/bookmark_bar_controller.h (working copy)
@@ -40,6 +40,13 @@
BOOL contentViewHasOffset_;
BOOL barShouldBeShown_;
+ // BookmarkNodes have a 64bit id. NSMenuItems have a 32bit tag used
+ // to represent the bookmark node they refer to. This map provides
+ // a mapping from one to the other, so we can properly identify the
+ // node from the item. When adding items in, we start with seedId_.
+ int32 seedId_;
+ std::map<int32,int64> menuTagMap_;
+
// Our bookmark buttons, ordered from L-->R.
scoped_nsobject<NSMutableArray> buttons_;
@@ -58,6 +65,8 @@
// Delegate which can open URLs for us.
id<BookmarkURLOpener> delegate_; // weak
+ IBOutlet NSView* buttonView_;
+ IBOutlet NSButton* offTheSideButton_;
IBOutlet NSMenu* buttonContextMenu_;
}
@@ -86,6 +95,8 @@
// Actions for manipulating bookmarks.
// From a button, ...
- (IBAction)openBookmark:(id)sender;
+- (IBAction)openFolderMenuFromButton:(id)sender;
+- (IBAction)openOffTheSideMenuFromButton:(id)sender;
// From a context menu over the button, ...
- (IBAction)openBookmarkInNewForegroundTab:(id)sender;
- (IBAction)openBookmarkInNewWindow:(id)sender;
@@ -98,7 +109,6 @@
- (IBAction)addPage:(id)sender;
- (IBAction)addOrRenameFolder:(id)sender;
-
@end
// Redirects from BookmarkBarBridge, the C++ object which glues us to
@@ -123,13 +133,19 @@
// These APIs should only be used by unit tests (or used internally).
-@interface BookmarkBarController(TestingAPI)
+@interface BookmarkBarController(InternalOrTestingAPI)
// Set the delegate for a unit test.
- (void)setDelegate:(id<BookmarkURLOpener>)delegate;
- (void)clearBookmarkBar;
+- (NSView*)buttonView;
- (NSArray*)buttons;
- (NSRect)frameForBookmarkButtonFromCell:(NSCell*)cell xOffset:(int*)xOffset;
- (void)checkForBookmarkButtonGrowth:(NSButton*)button;
+- (void)frameDidChange;
+- (BOOL)offTheSideButtonIsEnabled;
+- (NSMenu *)menuForFolderNode:(const BookmarkNode*)node;
+- (int64)nodeIdFromMenuTag:(int32)tag;
+- (int32)menuTagFromNodeId:(int64)menuid;
@end
#endif // CHROME_BROWSER_COCOA_BOOKMARK_BAR_CONTROLLER_H_
« no previous file with comments | « chrome/app/nibs/BookmarkBar.xib ('k') | chrome/browser/cocoa/bookmark_bar_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698