OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 UI_BASE_COCOA_MENU_CONTROLLER_H_ | 5 #ifndef UI_BASE_COCOA_MENU_CONTROLLER_H_ |
6 #define UI_BASE_COCOA_MENU_CONTROLLER_H_ | 6 #define UI_BASE_COCOA_MENU_CONTROLLER_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include "base/memory/scoped_nsobject.h" | 10 #include "base/memory/scoped_nsobject.h" |
11 #include "base/string16.h" | 11 #include "base/strings/string16.h" |
12 #include "ui/base/ui_export.h" | 12 #include "ui/base/ui_export.h" |
13 | 13 |
14 namespace ui { | 14 namespace ui { |
15 class MenuModel; | 15 class MenuModel; |
16 } | 16 } |
17 | 17 |
18 // A controller for the cross-platform menu model. The menu that's created | 18 // A controller for the cross-platform menu model. The menu that's created |
19 // has the tag and represented object set for each menu item. The object is a | 19 // has the tag and represented object set for each menu item. The object is a |
20 // NSValue holding a pointer to the model for that level of the menu (to | 20 // NSValue holding a pointer to the model for that level of the menu (to |
21 // allow for hierarchical menus). The tag is the index into that model for | 21 // allow for hierarchical menus). The tag is the index into that model for |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 atIndex:(NSInteger)index | 79 atIndex:(NSInteger)index |
80 fromModel:(ui::MenuModel*)model; | 80 fromModel:(ui::MenuModel*)model; |
81 - (NSMenu*)menuFromModel:(ui::MenuModel*)model; | 81 - (NSMenu*)menuFromModel:(ui::MenuModel*)model; |
82 // Returns the maximum width for the menu item. Returns -1 to indicate | 82 // Returns the maximum width for the menu item. Returns -1 to indicate |
83 // that there's no maximum width. | 83 // that there's no maximum width. |
84 - (int)maxWidthForMenuModel:(ui::MenuModel*)model | 84 - (int)maxWidthForMenuModel:(ui::MenuModel*)model |
85 modelIndex:(int)modelIndex; | 85 modelIndex:(int)modelIndex; |
86 @end | 86 @end |
87 | 87 |
88 #endif // UI_BASE_COCOA_MENU_CONTROLLER_H_ | 88 #endif // UI_BASE_COCOA_MENU_CONTROLLER_H_ |
OLD | NEW |