| OLD | NEW |
| 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 // Controller (MVC) for the bookmark menu. | 5 // Controller (MVC) for the bookmark menu. |
| 6 // All bookmark menu item commands get directed here. | 6 // All bookmark menu item commands get directed here. |
| 7 // Unfortunately there is already a C++ class named BookmarkMenuController. | 7 // Unfortunately there is already a C++ class named BookmarkMenuController. |
| 8 | 8 |
| 9 #ifndef CHROME_BROWSER_COCOA_BOOKMARK_MENU_COCOA_CONTROLLER_H_ | 9 #ifndef CHROME_BROWSER_COCOA_BOOKMARK_MENU_COCOA_CONTROLLER_H_ |
| 10 #define CHROME_BROWSER_COCOA_BOOKMARK_MENU_COCOA_CONTROLLER_H_ | 10 #define CHROME_BROWSER_COCOA_BOOKMARK_MENU_COCOA_CONTROLLER_H_ |
| 11 | 11 |
| 12 #import <Cocoa/Cocoa.h> | 12 #import <Cocoa/Cocoa.h> |
| 13 | 13 |
| 14 class BookmarkNode; | 14 class BookmarkNode; |
| 15 class BookmarkMenuBridge; | 15 class BookmarkMenuBridge; |
| 16 | 16 |
| 17 @interface BookmarkMenuCocoaController : NSObject { | 17 @interface BookmarkMenuCocoaController : NSObject { |
| 18 @private | 18 @private |
| 19 BookmarkMenuBridge* bridge_; // weak; owns me | 19 BookmarkMenuBridge* bridge_; // weak; owns me |
| 20 } | 20 } |
| 21 | 21 |
| 22 // Return an autoreleased string to be used as a menu title for the |
| 23 // given bookmark node. |
| 24 + (NSString*)menuTitleForNode:(const BookmarkNode*)node; |
| 25 |
| 22 - (id)initWithBridge:(BookmarkMenuBridge *)bridge; | 26 - (id)initWithBridge:(BookmarkMenuBridge *)bridge; |
| 23 | 27 |
| 24 // Called by any Bookmark menu item. | 28 // Called by any Bookmark menu item. |
| 25 // The menu item's tag is the bookmark ID. | 29 // The menu item's tag is the bookmark ID. |
| 26 - (IBAction)openBookmarkMenuItem:(id)sender; | 30 - (IBAction)openBookmarkMenuItem:(id)sender; |
| 27 | 31 |
| 28 @end // BookmarkMenuCocoaController | 32 @end // BookmarkMenuCocoaController |
| 29 | 33 |
| 30 | 34 |
| 31 @interface BookmarkMenuCocoaController (ExposedForUnitTests) | 35 @interface BookmarkMenuCocoaController (ExposedForUnitTests) |
| 32 - (const BookmarkNode*)nodeForIdentifier:(int)identifier; | 36 - (const BookmarkNode*)nodeForIdentifier:(int)identifier; |
| 33 - (void)openURLForNode:(const BookmarkNode*)node; | 37 - (void)openURLForNode:(const BookmarkNode*)node; |
| 34 @end // BookmarkMenuCocoaController (ExposedForUnitTests) | 38 @end // BookmarkMenuCocoaController (ExposedForUnitTests) |
| 35 | 39 |
| 36 #endif // CHROME_BROWSER_COCOA_BOOKMARK_MENU_COCOA_CONTROLLER_H_ | 40 #endif // CHROME_BROWSER_COCOA_BOOKMARK_MENU_COCOA_CONTROLLER_H_ |
| OLD | NEW |