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 #ifndef CHROME_BROWSER_UI_COCOA_MENU_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_MENU_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_COCOA_MENU_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_MENU_CONTROLLER_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #import "base/mac/cocoa_protocols.h" | |
11 #include "base/memory/scoped_nsobject.h" | 10 #include "base/memory/scoped_nsobject.h" |
12 | 11 |
13 namespace ui { | 12 namespace ui { |
14 class MenuModel; | 13 class MenuModel; |
15 } | 14 } |
16 | 15 |
17 // A controller for the cross-platform menu model. The menu that's created | 16 // A controller for the cross-platform menu model. The menu that's created |
18 // has the tag and represented object set for each menu item. The object is a | 17 // has the tag and represented object set for each menu item. The object is a |
19 // NSValue holding a pointer to the model for that level of the menu (to | 18 // NSValue holding a pointer to the model for that level of the menu (to |
20 // allow for hierarchical menus). The tag is the index into that model for | 19 // allow for hierarchical menus). The tag is the index into that model for |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 // Protected methods that subclassers can override. | 67 // Protected methods that subclassers can override. |
69 @interface MenuController (Protected) | 68 @interface MenuController (Protected) |
70 - (void)addItemToMenu:(NSMenu*)menu | 69 - (void)addItemToMenu:(NSMenu*)menu |
71 atIndex:(NSInteger)index | 70 atIndex:(NSInteger)index |
72 fromModel:(ui::MenuModel*)model | 71 fromModel:(ui::MenuModel*)model |
73 modelIndex:(int)modelIndex; | 72 modelIndex:(int)modelIndex; |
74 - (NSMenu*)menuFromModel:(ui::MenuModel*)model; | 73 - (NSMenu*)menuFromModel:(ui::MenuModel*)model; |
75 @end | 74 @end |
76 | 75 |
77 #endif // CHROME_BROWSER_UI_COCOA_MENU_CONTROLLER_H_ | 76 #endif // CHROME_BROWSER_UI_COCOA_MENU_CONTROLLER_H_ |
OLD | NEW |