| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_CONTEXT_MENU_COCOA_CONTROLLER
_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_CONTEXT_MENU_COCOA_CONTROLLER
_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_CONTEXT_MENU_COCOA_CONTROLLER
_H_ | 6 #define CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_CONTEXT_MENU_COCOA_CONTROLLER
_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/memory/scoped_nsobject.h" | 11 #include "base/mac/scoped_nsobject.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 | 13 |
| 14 @class BookmarkBarController; | 14 @class BookmarkBarController; |
| 15 class BookmarkContextMenuController; | 15 class BookmarkContextMenuController; |
| 16 class BookmarkContextMenuDelegateBridge; | 16 class BookmarkContextMenuDelegateBridge; |
| 17 class BookmarkModel; | 17 class BookmarkModel; |
| 18 class BookmarkNode; | 18 class BookmarkNode; |
| 19 @class MenuController; | 19 @class MenuController; |
| 20 | 20 |
| 21 // A controller to manage bookmark bar context menus. One instance of this | 21 // A controller to manage bookmark bar context menus. One instance of this |
| (...skipping 12 matching lines...) Expand all Loading... |
| 34 // The current |bookmarkNode_| for which |bookmarkContextMenuController_| and | 34 // The current |bookmarkNode_| for which |bookmarkContextMenuController_| and |
| 35 // |menuController_| are initialized. Weak, owned by the BookmarkModel. | 35 // |menuController_| are initialized. Weak, owned by the BookmarkModel. |
| 36 const BookmarkNode* bookmarkNode_; | 36 const BookmarkNode* bookmarkNode_; |
| 37 | 37 |
| 38 // The cross-platform BookmarkContextMenuController, containing the logic for | 38 // The cross-platform BookmarkContextMenuController, containing the logic for |
| 39 // which items and corresponding actions exist in the menu. | 39 // which items and corresponding actions exist in the menu. |
| 40 scoped_ptr<BookmarkContextMenuController> bookmarkContextMenuController_; | 40 scoped_ptr<BookmarkContextMenuController> bookmarkContextMenuController_; |
| 41 | 41 |
| 42 // Controller responsible for creating a Cocoa NSMenu from the cross-platform | 42 // Controller responsible for creating a Cocoa NSMenu from the cross-platform |
| 43 // SimpleMenuModel owned by the |bookmarkContextMenuController_|. | 43 // SimpleMenuModel owned by the |bookmarkContextMenuController_|. |
| 44 scoped_nsobject<MenuController> menuController_; | 44 base::scoped_nsobject<MenuController> menuController_; |
| 45 } | 45 } |
| 46 | 46 |
| 47 // Initializes the BookmarkContextMenuCocoaController for the given bookmark | 47 // Initializes the BookmarkContextMenuCocoaController for the given bookmark |
| 48 // bar |controller|. | 48 // bar |controller|. |
| 49 - (id)initWithBookmarkBarController:(BookmarkBarController*)controller; | 49 - (id)initWithBookmarkBarController:(BookmarkBarController*)controller; |
| 50 | 50 |
| 51 // Returns an NSMenu customized for |node|. Works under the assumption that | 51 // Returns an NSMenu customized for |node|. Works under the assumption that |
| 52 // only one menu should ever be shown at a time, and thus caches the last | 52 // only one menu should ever be shown at a time, and thus caches the last |
| 53 // returned menu and re-creates it if a menu for a different node is requested. | 53 // returned menu and re-creates it if a menu for a different node is requested. |
| 54 // Passing in a NULL |node| will return the menu for the bookmark bar itself. | 54 // Passing in a NULL |node| will return the menu for the bookmark bar itself. |
| 55 - (NSMenu*)menuForBookmarkNode:(const BookmarkNode*)node; | 55 - (NSMenu*)menuForBookmarkNode:(const BookmarkNode*)node; |
| 56 | 56 |
| 57 // Closes the menu, if it's currently open. | 57 // Closes the menu, if it's currently open. |
| 58 - (void)cancelTracking; | 58 - (void)cancelTracking; |
| 59 | 59 |
| 60 @end | 60 @end |
| 61 | 61 |
| 62 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_CONTEXT_MENU_COCOA_CONTROL
LER_H_ | 62 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_CONTEXT_MENU_COCOA_CONTROL
LER_H_ |
| OLD | NEW |