| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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. | |
| 6 // All bookmark menu item commands get directed here. | |
| 7 // Unfortunately there is already a C++ class named BookmarkMenuController. | |
| 8 | |
| 9 #ifndef CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_MENU_COCOA_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_MENU_COCOA_CONTROLLER_H_ |
| 10 #define CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_MENU_COCOA_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_MENU_COCOA_CONTROLLER_H_ |
| 11 | 7 |
| 12 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 13 | 9 |
| 14 #import "base/mac/scoped_nsobject.h" | 10 #import "base/mac/scoped_nsobject.h" |
| 15 #include "ui/base/window_open_disposition.h" | 11 #include "ui/base/window_open_disposition.h" |
| 16 | 12 |
| 17 class BookmarkMenuBridge; | 13 class BookmarkMenuBridge; |
| 18 | 14 |
| 19 namespace bookmarks { | 15 namespace bookmarks { |
| 20 class BookmarkNode; | 16 class BookmarkNode; |
| 21 } | 17 } |
| 22 | 18 |
| 19 // Controller (MVC) for the bookmark menu. |
| 20 // All bookmark menu item commands get directed here. |
| 21 // Unfortunately there is already a C++ class named BookmarkMenuController. |
| 23 @interface BookmarkMenuCocoaController : NSObject<NSMenuDelegate> { | 22 @interface BookmarkMenuCocoaController : NSObject<NSMenuDelegate> { |
| 24 @private | 23 @private |
| 25 BookmarkMenuBridge* bridge_; // weak; owns me | 24 BookmarkMenuBridge* bridge_; // weak; owns me |
| 26 base::scoped_nsobject<NSMenu> menu_; | 25 base::scoped_nsobject<NSMenu> menu_; |
| 27 } | 26 } |
| 28 | 27 |
| 29 // The Bookmarks menu | 28 // The Bookmarks menu |
| 30 @property(nonatomic, readonly) NSMenu* menu; | 29 @property(nonatomic, readonly) NSMenu* menu; |
| 31 | 30 |
| 32 // Return an autoreleased string to be used as a menu title for the | 31 // Return an autoreleased string to be used as a menu title for the |
| (...skipping 17 matching lines...) Expand all Loading... |
| 50 | 49 |
| 51 | 50 |
| 52 @interface BookmarkMenuCocoaController (ExposedForUnitTests) | 51 @interface BookmarkMenuCocoaController (ExposedForUnitTests) |
| 53 - (const bookmarks::BookmarkNode*)nodeForIdentifier:(int)identifier; | 52 - (const bookmarks::BookmarkNode*)nodeForIdentifier:(int)identifier; |
| 54 - (void)openURLForNode:(const bookmarks::BookmarkNode*)node; | 53 - (void)openURLForNode:(const bookmarks::BookmarkNode*)node; |
| 55 - (void)openAll:(NSInteger)tag | 54 - (void)openAll:(NSInteger)tag |
| 56 withDisposition:(WindowOpenDisposition)disposition; | 55 withDisposition:(WindowOpenDisposition)disposition; |
| 57 @end // BookmarkMenuCocoaController (ExposedForUnitTests) | 56 @end // BookmarkMenuCocoaController (ExposedForUnitTests) |
| 58 | 57 |
| 59 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_MENU_COCOA_CONTROLLER_H_ | 58 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_MENU_COCOA_CONTROLLER_H_ |
| OLD | NEW |