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

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_context_menu_cocoa_controller.h

Issue 865163003: bookmarks: Move BookmarkNode into 'bookmarks' namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: enhanced_bookmarks fix Created 5 years, 10 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 unified diff | Download patch
OLDNEW
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/mac/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 MenuController;
18
19 namespace bookmarks {
17 class BookmarkNode; 20 class BookmarkNode;
18 @class MenuController; 21 }
19 22
20 // A controller to manage bookmark bar context menus. One instance of this 23 // A controller to manage bookmark bar context menus. One instance of this
21 // class exists per bookmark bar controller, used for all of its context menus 24 // class exists per bookmark bar controller, used for all of its context menus
22 // (including those for items in bookmark bar folder drop downs). 25 // (including those for items in bookmark bar folder drop downs).
23 @interface BookmarkContextMenuCocoaController : NSObject { 26 @interface BookmarkContextMenuCocoaController : NSObject {
24 @private 27 @private
25 // Bookmark bar controller, used for retrieving the Browser, Profile and 28 // Bookmark bar controller, used for retrieving the Browser, Profile and
26 // NSWindow when instantiating the BookmarkContextMenuController. Weak, owns 29 // NSWindow when instantiating the BookmarkContextMenuController. Weak, owns
27 // us. 30 // us.
28 BookmarkBarController* bookmarkBarController_; 31 BookmarkBarController* bookmarkBarController_;
29 32
30 // Helper for receiving C++ callbacks. 33 // Helper for receiving C++ callbacks.
31 scoped_ptr<BookmarkContextMenuDelegateBridge> bridge_; 34 scoped_ptr<BookmarkContextMenuDelegateBridge> bridge_;
32 35
33 // The current |bookmarkNode_| for which |bookmarkContextMenuController_| and 36 // The current |bookmarkNode_| for which |bookmarkContextMenuController_| and
34 // |menuController_| are initialized. Weak, owned by the BookmarkModel. 37 // |menuController_| are initialized. Weak, owned by the BookmarkModel.
35 const BookmarkNode* bookmarkNode_; 38 const bookmarks::BookmarkNode* bookmarkNode_;
36 39
37 // The cross-platform BookmarkContextMenuController, containing the logic for 40 // The cross-platform BookmarkContextMenuController, containing the logic for
38 // which items and corresponding actions exist in the menu. 41 // which items and corresponding actions exist in the menu.
39 scoped_ptr<BookmarkContextMenuController> bookmarkContextMenuController_; 42 scoped_ptr<BookmarkContextMenuController> bookmarkContextMenuController_;
40 43
41 // Controller responsible for creating a Cocoa NSMenu from the cross-platform 44 // Controller responsible for creating a Cocoa NSMenu from the cross-platform
42 // SimpleMenuModel owned by the |bookmarkContextMenuController_|. 45 // SimpleMenuModel owned by the |bookmarkContextMenuController_|.
43 base::scoped_nsobject<MenuController> menuController_; 46 base::scoped_nsobject<MenuController> menuController_;
44 } 47 }
45 48
46 // Initializes the BookmarkContextMenuCocoaController for the given bookmark 49 // Initializes the BookmarkContextMenuCocoaController for the given bookmark
47 // bar |controller|. 50 // bar |controller|.
48 - (id)initWithBookmarkBarController:(BookmarkBarController*)controller; 51 - (id)initWithBookmarkBarController:(BookmarkBarController*)controller;
49 52
50 // Returns an NSMenu customized for |node|. Works under the assumption that 53 // Returns an NSMenu customized for |node|. Works under the assumption that
51 // only one menu should ever be shown at a time, and thus caches the last 54 // only one menu should ever be shown at a time, and thus caches the last
52 // returned menu and re-creates it if a menu for a different node is requested. 55 // returned menu and re-creates it if a menu for a different node is requested.
53 // Passing in a NULL |node| will return the menu for "empty" placeholder. 56 // Passing in a NULL |node| will return the menu for "empty" placeholder.
54 - (NSMenu*)menuForBookmarkNode:(const BookmarkNode*)node; 57 - (NSMenu*)menuForBookmarkNode:(const bookmarks::BookmarkNode*)node;
55 58
56 // Returns an NSMenu customized for the bookmark bar. 59 // Returns an NSMenu customized for the bookmark bar.
57 - (NSMenu*)menuForBookmarkBar; 60 - (NSMenu*)menuForBookmarkBar;
58 61
59 // Closes the menu, if it's currently open. 62 // Closes the menu, if it's currently open.
60 - (void)cancelTracking; 63 - (void)cancelTracking;
61 64
62 @end 65 @end
63 66
64 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_CONTEXT_MENU_COCOA_CONTROL LER_H_ 67 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_CONTEXT_MENU_COCOA_CONTROL LER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698