OLD | NEW |
| (Empty) |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #import "chrome/browser/cocoa/autoseparating_menu.h" | |
6 | |
7 @implementation AutoseparatingMenu | |
8 | |
9 - (NSMenuItem *)insertItemWithTitle:(NSString *)aString | |
10 action:(SEL)aSelector | |
11 keyEquivalent:(NSString *)keyEquiv | |
12 atIndex:(NSInteger)index { | |
13 if ([aString isEqualToString:@"-"]) { | |
14 NSMenuItem* separator = [NSMenuItem separatorItem]; | |
15 [self insertItem:separator | |
16 atIndex:index]; | |
17 return separator; | |
18 } else { | |
19 return [super insertItemWithTitle:aString | |
20 action:aSelector | |
21 keyEquivalent:keyEquiv | |
22 atIndex:index]; | |
23 } | |
24 } | |
25 | |
26 @end | |
OLD | NEW |