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 #import "base/cocoa_protocols_mac.h" | 14 #import "base/cocoa_protocols_mac.h" |
15 | 15 |
16 class BookmarkNode; | 16 class BookmarkNode; |
17 class BookmarkMenuBridge; | 17 class BookmarkMenuBridge; |
18 | 18 |
19 @interface BookmarkMenuCocoaController : NSObject<NSMenuDelegate> { | 19 @interface BookmarkMenuCocoaController : NSObject<NSMenuDelegate> { |
20 @private | 20 @private |
21 BookmarkMenuBridge* bridge_; // weak; owns me | 21 BookmarkMenuBridge* bridge_; // weak; owns me |
22 } | 22 } |
23 | 23 |
24 // The Bookmarks menu | 24 // The Bookmarks menu |
25 @property (readonly) NSMenu* menu; | 25 @property (nonatomic, readonly) NSMenu* menu; |
26 | 26 |
27 // Return an autoreleased string to be used as a menu title for the | 27 // Return an autoreleased string to be used as a menu title for the |
28 // given bookmark node. | 28 // given bookmark node. |
29 + (NSString*)menuTitleForNode:(const BookmarkNode*)node; | 29 + (NSString*)menuTitleForNode:(const BookmarkNode*)node; |
30 | 30 |
31 - (id)initWithBridge:(BookmarkMenuBridge *)bridge; | 31 - (id)initWithBridge:(BookmarkMenuBridge *)bridge; |
32 | 32 |
33 // Called by any Bookmark menu item. | 33 // Called by any Bookmark menu item. |
34 // The menu item's tag is the bookmark ID. | 34 // The menu item's tag is the bookmark ID. |
35 - (IBAction)openBookmarkMenuItem:(id)sender; | 35 - (IBAction)openBookmarkMenuItem:(id)sender; |
36 | 36 |
37 @end // BookmarkMenuCocoaController | 37 @end // BookmarkMenuCocoaController |
38 | 38 |
39 | 39 |
40 @interface BookmarkMenuCocoaController (ExposedForUnitTests) | 40 @interface BookmarkMenuCocoaController (ExposedForUnitTests) |
41 - (const BookmarkNode*)nodeForIdentifier:(int)identifier; | 41 - (const BookmarkNode*)nodeForIdentifier:(int)identifier; |
42 - (void)openURLForNode:(const BookmarkNode*)node; | 42 - (void)openURLForNode:(const BookmarkNode*)node; |
43 @end // BookmarkMenuCocoaController (ExposedForUnitTests) | 43 @end // BookmarkMenuCocoaController (ExposedForUnitTests) |
44 | 44 |
45 #endif // CHROME_BROWSER_COCOA_BOOKMARK_MENU_COCOA_CONTROLLER_H_ | 45 #endif // CHROME_BROWSER_COCOA_BOOKMARK_MENU_COCOA_CONTROLLER_H_ |
OLD | NEW |